ajout du mode Arene où on choisi les bot qui s'affronte et le nombre de partie
This commit is contained in:
38
fr/iut_fbleau/Avalam/ArenaGame.java
Normal file
38
fr/iut_fbleau/Avalam/ArenaGame.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package fr.iut_fbleau.Avalam;
|
||||
|
||||
import fr.iut_fbleau.GameAPI.AbstractGame;
|
||||
import fr.iut_fbleau.GameAPI.AbstractGamePlayer;
|
||||
import fr.iut_fbleau.GameAPI.IBoard;
|
||||
import fr.iut_fbleau.GameAPI.Player;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
/**
|
||||
* Classe pour jouer une partie entre deux bots sans interface graphique.
|
||||
* Utilisée dans le mode Arène.
|
||||
*/
|
||||
public class ArenaGame extends AbstractGame {
|
||||
|
||||
/**
|
||||
* Construit une partie Arène entre deux bots.
|
||||
*
|
||||
* @param board plateau initial
|
||||
* @param bot1 bot pour PLAYER1
|
||||
* @param bot2 bot pour PLAYER2
|
||||
*/
|
||||
public ArenaGame(IBoard board, AbstractGamePlayer bot1, AbstractGamePlayer bot2) {
|
||||
super(board, createPlayerMap(bot1, bot2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée la map des joueurs pour AbstractGame.
|
||||
*/
|
||||
private static EnumMap<Player, AbstractGamePlayer> createPlayerMap(
|
||||
AbstractGamePlayer bot1, AbstractGamePlayer bot2) {
|
||||
EnumMap<Player, AbstractGamePlayer> map = new EnumMap<>(Player.class);
|
||||
map.put(Player.PLAYER1, bot1);
|
||||
map.put(Player.PLAYER2, bot2);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user