public void RemoveEgg(Egg egg) { int index = -1; for (int i = 0; i < m_Eggs.Count; i++) { if (m_Eggs[i] == egg) { index = i; break; } } if (index != -1) { m_Actors.RemoveAt(index); } }
public bool Unserialize(Core.BinaryFileReader reader) { string id = reader.ReadString(); if (id != c_SerializeIdentifier) { return(false); } int version = reader.ReadInt(); if (version >= 0) { // version 0 for (int i = 0; i < 4; i++) { m_Chunks[i] = reader.ReadInt(); } m_Tileset = reader.ReadByte(); int count; count = reader.ReadInt(); for (int i = 0; i < count; i++) { Actor actor = new Actor(); actor.Unserialize(reader); m_Actors.Add(actor); } byte length = reader.ReadByte(); count = reader.ReadInt(); for (int i = 0; i < count; i++) { Egg egg = new Egg(); egg.Unserialize(reader); m_Eggs.Add(egg); } } return(true); }