Search in sources :

Example 1 with ProAi

use of games.strategy.triplea.ai.pro.ProAi in project triplea by triplea-game.

the class TripleA method createPlayers.

@Override
public Set<IGamePlayer> createPlayers(final Map<String, String> playerNames) {
    final Set<IGamePlayer> players = new HashSet<>();
    for (final String name : playerNames.keySet()) {
        final String type = playerNames.get(name);
        if (type.equals(WEAK_COMPUTER_PLAYER_TYPE)) {
            players.add(new WeakAi(name, type));
        } else if (type.equals(FAST_COMPUTER_PLAYER_TYPE)) {
            players.add(new FastAi(name, type));
        } else if (type.equals(PRO_COMPUTER_PLAYER_TYPE)) {
            players.add(new ProAi(name, type));
        } else if (type.equals(DOESNOTHINGAI_COMPUTER_PLAYER_TYPE)) {
            players.add(new DoesNothingAi(name, type));
        } else if (type.equals(HUMAN_PLAYER_TYPE) || type.equals(CLIENT_PLAYER_TYPE)) {
            final TripleAPlayer player = new TripleAPlayer(name, type);
            players.add(player);
        } else {
            throw new IllegalStateException("Player type not recognized:" + type);
        }
    }
    return players;
}
Also used : IGamePlayer(games.strategy.engine.gamePlayer.IGamePlayer) WeakAi(games.strategy.triplea.ai.weak.WeakAi) ITripleAPlayer(games.strategy.triplea.player.ITripleAPlayer) DoesNothingAi(games.strategy.triplea.ai.weak.DoesNothingAi) FastAi(games.strategy.triplea.ai.fast.FastAi) ProAi(games.strategy.triplea.ai.pro.ProAi) HashSet(java.util.HashSet)

Aggregations

IGamePlayer (games.strategy.engine.gamePlayer.IGamePlayer)1 FastAi (games.strategy.triplea.ai.fast.FastAi)1 ProAi (games.strategy.triplea.ai.pro.ProAi)1 DoesNothingAi (games.strategy.triplea.ai.weak.DoesNothingAi)1 WeakAi (games.strategy.triplea.ai.weak.WeakAi)1 ITripleAPlayer (games.strategy.triplea.player.ITripleAPlayer)1 HashSet (java.util.HashSet)1