protected override Entity createEnemy(EntitiyType type)
        {
            TextureManager texManager = TextureManager.Textures;

            Entity e;

            switch (type)
            {
            case EntitiyType.Grunt1:
                e = new Grunt1(Vector2.Zero, texManager.Get(TextureManager.Type.Grunt1));
                break;

            case EntitiyType.Grunt2:
                e = new Grunt2(Vector2.Zero, texManager.Get(TextureManager.Type.Grunt2));
                break;

            case EntitiyType.Boss1:
                e = new Boss1(Vector2.Zero, texManager.Get(TextureManager.Type.Boss1));
                break;

            case EntitiyType.Boss2:
                e = new Boss2(Vector2.Zero, texManager.Get(TextureManager.Type.Boss2));
                break;

            case EntitiyType.Player:
                e        = new Player(Vector2.Zero, texManager.Get(TextureManager.Type.SpaceshipPlayer), 7.0f);
                e.Health = 5;
                break;

            default:
                throw new Exception("Warning: StandardEnemyFactory: Request for unsupported Enemy");
            }
            return(e);
        }
Beispiel #2
0
 protected abstract Entity createEnemy(EntitiyType type);
Beispiel #3
0
 /// <summary>
 /// Gets a new instance of an Enemy of EnemyFactory.EnemyType
 /// </summary>
 /// <param name="type"> EnemyFactory.EnemyType </param>
 /// <returns></returns>
 public Entity CreateEnemy(EntitiyType type)
 {
     return(this.createEnemy(type));
 }