All Downloads are FREE. Search and download functionalities are using the official Maven repository.

skadistats.clarity.io.s1.DotaS1FieldReader Maven / Gradle / Ivy

Go to download

Clarity is an open source replay parser for Dota 2, CSGO, CS2 and Deadlock written in Java.

There is a newer version: 3.1.1
Show newest version
package skadistats.clarity.io.s1;

import skadistats.clarity.io.bitstream.BitStream;
import skadistats.clarity.model.s1.S1FieldPath;

public class DotaS1FieldReader extends S1FieldReader {

    @Override
    protected int readIndices(BitStream bs, S1DTClass dtClass) {
        var n = 0;
        var cursor = -1;
        while (true) {
            if (bs.readBitFlag()) {
                cursor += 1;
            } else {
                var offset = bs.readVarUInt();
                if (offset == MAX_PROPERTIES) {
                    break;
                } else {
                    cursor += offset + 1;
                }
            }
            fieldPaths[n++] = new S1FieldPath(dtClass.getIndexMapping()[cursor]);
        }
        return n;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy