public virtual void AddObject(GameObject obj) { if (obj is MovingObject) { if (obj is SpaceShip) { AddSpaceShip(obj); } else { this.AddMovingObject(obj as MovingObject); } } else { this.AddStaticObject(obj); } }
private void AddStaticObject(GameObject obj) { this.staticObjects.Add(obj); this.allObjects.Add(obj); }
private void AddSpaceShip(GameObject obj) { if (obj is PlayerShip) { this.playerShip = obj as PlayerShip; } this.AddStaticObject(obj); }