Ejemplo n.º 1
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt32(ID);
                if (Controllables == null)
                {
                    Controllables = new SpawnerControllable[ControllableCount];

                    for (int xb = 0; xb < ControllableCount; xb++)
                    {
                        Controllables[xb] = new SpawnerControllable();
                    }
                }
                io.WriteBits(Controllables.Length, 0xA);
                foreach (SpawnerControllable t in Controllables)
                {
                    t.Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 public Spawner Read(DAIIO io)
 {
     xLength           = io.ReadBit2(LengthBits);
     ID                = io.ReadInt32();
     ControllableCount = (short)io.ReadBit2(0xA);
     Controllables     = new SpawnerControllable[ControllableCount];
     for (int i = 0; i < ControllableCount; i++)
     {
         Controllables[i] = new SpawnerControllable().Read(io);
     }
     return(this);
 }