public GameObject Create(GameObject.Name name, BirdCategory.Type type, float posX = 0.0f, float posY = 0.0f) { GameObject pGameObj = null; switch (type) { case BirdCategory.Type.Green: pGameObj = new GreenBird(GameSprite.Name.GreenBird, name, posX, posY); break; case BirdCategory.Type.Red: pGameObj = new RedBird(GameSprite.Name.RedBird, name, posX, posY); break; case BirdCategory.Type.White: pGameObj = new WhiteBird(GameSprite.Name.WhiteBird, name, posX, posY); break; case BirdCategory.Type.Yellow: pGameObj = new YellowBird(GameSprite.Name.YellowBird, name, posX, posY); break; case BirdCategory.Type.Grid: pGameObj = new BirdGrid(name); break; case BirdCategory.Type.Column: pGameObj = new BirdColumn(name); break; default: // something is wrong Debug.Assert(false); break; } // add it to the gameObjectManager Debug.Assert(pGameObj != null); //GameObjectMan.Attach(pGameObj); // Attached to Group pGameObj.ActivateGameSprite(this.pSpriteBatch); pGameObj.ActivateCollisionSprite(this.pBoxBatch); return(pGameObj); }
public virtual void VisitWhiteBird(WhiteBird b) { // no differed to subcass Debug.WriteLine("Visit by Octopus not implemented"); Debug.Assert(false); }