@Override
public boolean executer(String parametres) {
if (parametres.trim() == "")
return false;
if (parametres.equals("bataille")) {
PluginManager pmanager = PluginManager.getInstance();
Game game = pmanager.getNewGame("Cero official bataille");
for (Rule r : pmanager.getGameRules(game.getGameName()))
game.getRules().add(r);
// 1 joueur humain suffira
for (int i = 0; i < 1; i++)
game.getPlayers().add(pmanager.getNewPlayer(game.getGameName()));
// une AI de chaque
for (String aip : pmanager.getAIsName(game.getGameName()))
game.getPlayers().add(pmanager.getNewAI(game.getGameName(), aip));
for (GameInitializer init : pmanager.getGameInitializers(game.getGameName()))
game.getGameInitializers().add(init);
try {
game.startGame();
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
return false;
}
return true;
} else if (parametres.equals("uno")) {
PluginManager pmanager = PluginManager.getInstance();
Game game = pmanager.getNewGame("Cero official uno");
for (Rule r : pmanager.getGameRules(game.getGameName()))
game.getRules().add(r);
// 1 joueur humain suffira
for (int i = 0; i < 1; i++)
game.getPlayers().add(pmanager.getNewPlayer(game.getGameName()));
// 3 AI de chaque
for (String aip : pmanager.getAIsName(game.getGameName()))
for (int i = 0; i < 3; i++)
game.getPlayers().add(pmanager.getNewAI(game.getGameName(), aip));
for (GameInitializer init : pmanager.getGameInitializers(game.getGameName()))
game.getGameInitializers().add(init);
try {
game.startGame();
} catch (Exception e) {