public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (LootMaps == null)
                {
                    LootMaps = new LootMap[LootMapCount];

                    for (int xb = 0; xb < LootMapCount; xb++)
                    {
                        LootMaps[xb] = new LootMap();
                    }
                }
                io.WriteInt16((short)LootMaps.Length);
                for (int i = 0; i < LootMapCount; i++)
                {
                    LootMaps[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
 public PersistentLoot Read(DAIIO io)
 {
     xLength      = io.ReadBit2(LengthBits);
     LootMapCount = io.ReadInt16();
     LootMaps     = new LootMap[LootMapCount];
     for (int i = 0; i < LootMapCount; i++)
     {
         LootMaps[i] = new LootMap().Read(io);
     }
     return(this);
 }