Beispiel #1
0
 public LootManager Read(DAIIO io)
 {
     xLength = io.ReadBit2(LengthBits);
     Version = io.ReadInt16();
     if (Version > 2)
     {
         PersistentLoot    = new PersistentLoot().Read(io);
         DynamicLootOwners = new DynamicLootOwners().Read(io);
     }
     return(this);
 }
Beispiel #2
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt16(Version);
                if (Version > 2)
                {
                    PersistentLoot.Write(io);
                    DynamicLootOwners.Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }