use of games.strategy.triplea.ai.weak.DoesNothingAi 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;
}
Aggregations