コード例 #1
0
 public GameManager()
 {
     enemySelection = new EnemyFactorySelector();
     bulletFactory  = new BulletFactory();
     interpreter    = new Interpreter();
     powerupFactory = new PowerUpFactory();
 }
コード例 #2
0
        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);
        }