blueLagoon: pointed endPhase to state object

This commit is contained in:
2023-04-24 18:10:57 +10:00
parent 70f3b3c707
commit bfc7070b78
3 changed files with 72 additions and 50 deletions

View File

@@ -823,7 +823,13 @@ public class BlueLagoon {
* @return a string representing the new state achieved by following the end of phase rules
*/
public static String endPhase(String stateString){
return ""; // FIXME Task 12
State state = new State(stateString);
state.scorePhase();
if (state.getCurrentPhase() == 'E') {
state.cleanBoard();
state.distributeResources();
}
return state.toString();
}
/**