legitbugfix #19

Open
Alistair VAISSE wants to merge 10 commits from legitbugfix into master
20 changed files with 10 additions and 4 deletions
Showing only changes of commit e0a2c2642a - Show all commits

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

View File

@@ -1,7 +1,6 @@
package fr.iut_fbleau.HexGame; package fr.iut_fbleau.HexGame;
import fr.iut_fbleau.GameAPI.*; import fr.iut_fbleau.GameAPI.*;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.Scanner; import java.util.Scanner;
@@ -11,7 +10,7 @@ import java.util.Scanner;
public class HexMain { public class HexMain {
public static void main(String[] args) { public static void main(String[] args) {
int size = 11; int size = 7;
if (args.length >= 1) { if (args.length >= 1) {
try { size = Integer.parseInt(args[0]); } catch (NumberFormatException ignored) {} try { size = Integer.parseInt(args[0]); } catch (NumberFormatException ignored) {}
} }
@@ -19,12 +18,19 @@ public class HexMain {
HexBoard board = new HexBoard(size); HexBoard board = new HexBoard(size);
Scanner sc = new Scanner(System.in); Scanner sc = new Scanner(System.in);
Result res;
EnumMap<Player, AbstractGamePlayer> players = new EnumMap<>(Player.class); EnumMap<Player, AbstractGamePlayer> players = new EnumMap<>(Player.class);
players.put(Player.PLAYER1, new HumanConsolePlayer(Player.PLAYER1, sc)); players.put(Player.PLAYER1, new HumanConsolePlayer(Player.PLAYER1, sc));
players.put(Player.PLAYER2, new HumanConsolePlayer(Player.PLAYER2, sc)); players.put(Player.PLAYER2, new HumanConsolePlayer(Player.PLAYER2, sc));
if (args.length>=2 && args[1].equals("autoplay")) {
Simulation sim = new Simulation(board, players);
res = sim.run();
} else {
AbstractGame game = new AbstractGame(board, players) {}; AbstractGame game = new AbstractGame(board, players) {};
Result res = game.run(); res = game.run();
}
System.out.println(board); System.out.println(board);
System.out.println("Résultat (du point de vue de PLAYER1) : " + res); System.out.println("Résultat (du point de vue de PLAYER1) : " + res);