示例#1
0
        public virtual void AddObject(GameObject obj)
        {
            if (obj is MovingObject)
            {
                this.AddMovingObject(obj as MovingObject);
            }
            else
            {
                if (obj is Racket)
                {
                    AddRacket(obj);

                }
                else
                {
                    this.AddStaticObject(obj);
                }
            }
        }
示例#2
0
 private void AddStaticObject(GameObject obj)
 {
     this.staticObjects.Add(obj);
     this.allObjects.Add(obj);
 }
示例#3
0
        private void AddRacket(GameObject obj)
        {
            if (this.playerRacket != null)
            {
                this.allObjects.Remove(this.playerRacket);
                this.staticObjects.Remove(this.playerRacket);
            }

            this.playerRacket = obj as Racket;
            this.AddStaticObject(obj);
        }