Files
BUT3ProjetJeuGroupe/fr/iut_fbleau/Avalam/ArenaGame.java
2026-02-01 17:24:43 +01:00

45 lines
1.2 KiB
Java

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.
*
* @version 1.0
*/
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.
*
* @param bot1 bot pour PLAYER1
* @param bot2 bot pour PLAYER2
* @return une EnumMap associant chaque Player à son bot
*/
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;
}
}