Пример #1
0
    internal static NPCDialogDifficulty Read(InternalBitArray bits)
    {
        var output = new NPCDialogDifficulty();

        for (int i = 0; i < output._dialogs.Length; i++)
        {
            var data = new NPCDialogData
            {
                Introduction    = bits[i],
                Congratulations = bits[i + (0x18 * 8)]
            };
            output._dialogs[i] = data;
        }

        return(output);
    }
Пример #2
0
    public static NPCDialogSection Read(IBitReader reader)
    {
        var npcDialogSection = new NPCDialogSection
        {
            Header = reader.ReadUInt16(),
            Length = reader.ReadUInt16()
        };

        Span <byte> bytes = stackalloc byte[0x30];

        reader.ReadBytes(bytes);
        using var bits = new InternalBitArray(bytes);

        for (int i = 0; i < npcDialogSection._difficulties.Length; i++)
        {
            npcDialogSection._difficulties[i] = NPCDialogDifficulty.Read(bits);
        }

        return(npcDialogSection);
    }
Пример #3
0
    internal InternalBitArray?Traverse(char symbol, InternalBitArray data)
    {
        if (IsLeaf())
        {
            return(symbol.Equals(Symbol) ? data : null);
        }
        else
        {
            if (Left is not null)
            {
                data.Add(false);
                var left = Left.Traverse(symbol, data);
                if (left is null)
                {
                    data.Length--;
                }
                else
                {
                    return(data);
                }
            }

            if (Right is not null)
            {
                data.Add(true);
                var right = Right.Traverse(symbol, data);
                if (right is null)
                {
                    data.Length--;
                }
                else
                {
                    return(data);
                }
            }

            return(null);
        }
    }
Пример #4
0
 private ActVWaypoints(InternalBitArray flags) => _flags = flags;
Пример #5
0
 private Quest(InternalBitArray flags) => _flags = flags;
Пример #6
0
 public Status(byte flags)
 {
     _flags = new InternalBitArray(stackalloc byte[] { flags });
Пример #7
0
 public BitReader(ReadOnlySpan <byte> bytes)
 {
     Position = 0;
     _bits    = new InternalBitArray(bytes);
 }