task 9 and 10: Added using state class

This commit is contained in:
2023-04-24 17:36:20 +10:00
parent 8ed19d75bd
commit 899497d037
5 changed files with 107 additions and 12 deletions

View File

@@ -76,11 +76,15 @@ public class StateTest {
// Test endPhase
while (!state.isPhaseOver()) {
if (!state.getCurrentPlayer().canPlay(state)) state.nextPlayer();
if (!state.getCurrentPlayer().canPlay(state)) {
System.out.println("Player " + state.getCurrentPlayerID() + " can't play");
state.nextPlayer();
}
state.getCurrentPlayer().doRandomMove(state);
}
state.scorePhase();
System.out.println(state);
System.out.println(state.getCurrentPhase());
System.out.println(state.scoreString());
}