Example #1
0
 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);
     }
 }
Example #2
0
 private void AddStaticObject(GameObject obj)
 {
     this.staticObjects.Add(obj);
     this.allObjects.Add(obj);
 }
Example #3
0
 private void AddSpaceShip(GameObject obj)
 {
     if (obj is PlayerShip)
     {
         this.playerShip = obj as PlayerShip;
     }
     this.AddStaticObject(obj);
 }