Commit 17cc626e authored by Alexandre DESMONTILS's avatar Alexandre DESMONTILS
Browse files

ajout de la méthode effet pour les cartes traques et survies

parent 35414469
......@@ -44,6 +44,8 @@ public interface GameInterface {
String piocherTraque(int idGame);
void defausserCarteTraque(int idGame, CarteTraque carte);
String piocherSurvie(int idGame, int id);
void defausserCarteSurvie(int idGame, CarteSurvie carte);
......
......@@ -27,7 +27,7 @@ public class GameController implements GameInterface {
checkArgument(expectedPlayers > 1 && expectedPlayers <= 7, "A game must have between 2 and 7 players");
int newId = idCounter.incrementAndGet();
Game newGame = new Game(expectedPlayers);
Game newGame = new Game(expectedPlayers, newId);
games.put(newId, newGame);
return newId;
......@@ -98,6 +98,11 @@ public class GameController implements GameInterface {
return this.games.get(idGame).piocherTraque();
}
@Override
public void defausserCarteTraque(int idGame, CarteTraque carte) {
this.games.get(idGame).defausserCarteTraque(carte);
}
@Override
public String piocherSurvie(int idGame, int id) {
return games.get(idGame).piocherSurvie(id);
......
......@@ -267,6 +267,9 @@ public class PlayerProxy implements PlayerInterface, Creature, Traque {
@Override
public void defausserMainTraque() {
for (CarteTraque i : this.mainTraque) {
gameController.defausserCarteTraque(this.idGame, i);
}
this.mainTraque = new ArrayList<>();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment