public void Add(GameObject gameObject, float depth)
        {
            DrawListData newData;

            if (!gameObject.IsInitialised)
                gameObject.Initialise();
            gameObject.m_drawingList = this;

            int i;
            for (i = 0; i < m_drawables.Count; ++i)
                if (depth < m_drawables[i].depth)
                    break;

            newData.depth = depth;
            newData.drawable = gameObject;
            m_drawables.Insert(i, newData);
        }
 public void Remove(GameObject gameObject)
 {
     m_drawables.RemoveAll(dld => dld.drawable == gameObject);
     gameObject.m_drawingList = null;
 }
 public void Remove(GameObject gameObject)
 {
     m_updatables.RemoveAll(dld => dld.updatable == gameObject);
     gameObject.m_updateList = null;
 }
        public GameObject(GameObject objectToCopy)
        {
            m_transform = new Transform(objectToCopy.Transform);
            if (objectToCopy.Sprite != null)
                m_sprite = new Sprite(objectToCopy.Sprite, m_transform);
            if (objectToCopy.Physics != null)
                m_physics = new PhysicsComponent(objectToCopy.Physics, m_transform);
            //if (objectToCopy.Destructible != null)
            //    m_physics = new DestructibleComponent(objectToCopy.Destructible, m_transform);
            if (objectToCopy.m_updateList != null)
                m_updateList = objectToCopy.m_updateList;
            if (objectToCopy.m_drawingList != null)
                m_drawingList = objectToCopy.m_drawingList;

            if (objectToCopy.m_spawners != null)
            {
                m_spawners = new List<Spawner>();
                for (int i = 0; i < objectToCopy.m_spawners.Count; ++i)
                    m_spawners.Add(new Spawner(m_spawners[i]));
            }
        }
 public Spawner(Spawner spawnerToCopy)
 {
     m_owner = spawnerToCopy.m_owner;
     m_gene = new Gene(spawnerToCopy.m_gene);
     m_spawnArea = spawnerToCopy.m_spawnArea;
 }
 public Spawner(Gene sectionGene, IArea spawnArea)
 {
     m_owner = null;
     m_gene = sectionGene;
     m_spawnArea = spawnArea;
 }
 public Spawner(GameObject owner, Gene sectionGene, IArea spawnArea)
 {
     m_owner = owner;
     m_gene = sectionGene;
     m_spawnArea = spawnArea;
 }