Example #1
0
    private WaypointsDifficulty(IBitReader reader)
    {
        Header = reader.ReadUInt16();
        ActI   = ActIWaypoints.Read(reader);
        ActII  = ActIIWaypoints.Read(reader);
        ActIII = ActIIIWaypoints.Read(reader);
        ActIV  = ActIVWaypoints.Read(reader);
        ActV   = ActVWaypoints.Read(reader);

        reader.Align();
        reader.AdvanceBits(17 * 8);
    }
Example #2
0
    public static Attributes Read(IBitReader reader)
    {
        var itemStatCost = Core.MetaData.ItemStatCostData;
        var attributes   = new Attributes
        {
            Header = reader.ReadUInt16()
        };
        ushort id = reader.ReadUInt16(9);

        while (id != 0x1ff)
        {
            var property  = itemStatCost.GetById(id);
            int attribute = reader.ReadInt32(property?["CSvBits"].ToInt32() ?? 0);
            int valShift  = property?["ValShift"].ToInt32() ?? 0;
            if (valShift > 0)
            {
                attribute >>= valShift;
            }
            attributes.Stats.Add(property?["Stat"].Value ?? string.Empty, attribute);
            id = reader.ReadUInt16(9);
        }
        reader.Align();
        return(attributes);
    }