state: Added simple mode for isPhaseOver()
This commit is contained in:
@@ -412,6 +412,23 @@ public class State {
|
||||
return !resourcesLeft || !moveLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* is the phase over?
|
||||
* @param simple boolean don't check all player moves
|
||||
*/
|
||||
public boolean isPhaseOver(boolean simple){
|
||||
boolean resourcesLeft = false;
|
||||
for (Resource r : resources) {
|
||||
if (!r.isClaimed() && r.getType() != 'S') resourcesLeft = true;
|
||||
}
|
||||
|
||||
boolean moveLeft = false;
|
||||
if (getCurrentPlayer().canPlay(this)) moveLeft = true;
|
||||
|
||||
|
||||
return !resourcesLeft || !moveLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean board for next phase
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user