public GameManager() { enemySelection = new EnemyFactorySelector(); bulletFactory = new BulletFactory(); interpreter = new Interpreter(); powerupFactory = new PowerUpFactory(); }
public static Enemy CreateEnemey(Vector2 pos, Property.EnemyType t, int movementStrategy, int bulletStrategy) { EnemyFactorySelector enemySelection = new EnemyFactorySelector(); EnemyFactory enemyFactory = enemySelection.SelectFactory(t); // enemy factory will become the necessary factory depending on what enemy type is passed in Enemy newEnemy = enemyFactory.CreateEnemy(pos, movementStrategy, bulletStrategy); // A unique ID must be set in the factory return(newEnemy); }