public virtual void AddObject(GameObject obj) { if (obj is MovingObject) { this.AddMovingObject(obj as MovingObject); } else { if (obj is SnakeHead) { AddSnake(obj); } else { this.AddStaticObject(obj); } } }
private void AddStaticObject(GameObject obj) { this.staticObjects.Add(obj); this.allObjects.Add(obj); }
private void AddSnake(GameObject obj) { RemoveRacket(); this.snakeHead = obj as SnakeHead; this.AddObject(obj); }