Fix:Game Automatic Slot
This commit is contained in:
@@ -301,10 +301,9 @@ public class Game implements Serializable {
|
|||||||
tempCard.insert(player);
|
tempCard.insert(player);
|
||||||
board.removeUpperTribeCard(tempCard);
|
board.removeUpperTribeCard(tempCard);
|
||||||
currentState.UpperDrawn();
|
currentState.UpperDrawn();
|
||||||
if(currentState.getNUpper() ==0 && currentState.getNLower() ==0)
|
if((currentState.getNLower() ==0 ||( getLowerListTribeCards().size()==0 && getLowerListBuilding().size()==0)) && ((currentState.getNUpper() ==0)||( getUpperListTribeCards().size()==0 && getUpperListBuilding().size()==0)))
|
||||||
nextPlayerSetup();
|
nextPlayerSetup();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -343,7 +342,7 @@ public class Game implements Serializable {
|
|||||||
tempCard.insert(player);
|
tempCard.insert(player);
|
||||||
board.removeLowerTribeCard(tempCard);
|
board.removeLowerTribeCard(tempCard);
|
||||||
currentState.LowerDrawn();
|
currentState.LowerDrawn();
|
||||||
if(currentState.getNLower() ==0 && currentState.getNUpper() ==0)
|
if((currentState.getNLower() ==0 ||( getLowerListTribeCards().size()==0 && getLowerListBuilding().size()==0)) && ((currentState.getNUpper() ==0)||( getUpperListTribeCards().size()==0 && getUpperListBuilding().size()==0)))
|
||||||
nextPlayerSetup();
|
nextPlayerSetup();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -382,7 +381,7 @@ public class Game implements Serializable {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
if(currentState.getNLower() ==0 && currentState.getNUpper() ==0)
|
if((currentState.getNLower() ==0 ||( getLowerListTribeCards().size()==0 && getLowerListBuilding().size()==0)) && ((currentState.getNUpper() ==0)||( getUpperListTribeCards().size()==0 && getUpperListBuilding().size()==0)))
|
||||||
nextPlayerSetup();
|
nextPlayerSetup();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -422,7 +421,7 @@ public class Game implements Serializable {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
if(currentState.getNLower() ==0 && currentState.getNUpper() ==0)
|
if((currentState.getNLower() ==0 ||( getLowerListTribeCards().size()==0 && getLowerListBuilding().size()==0)) && ((currentState.getNUpper() ==0)||( getUpperListTribeCards().size()==0 && getUpperListBuilding().size()==0)))
|
||||||
nextPlayerSetup();
|
nextPlayerSetup();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -555,10 +554,16 @@ public class Game implements Serializable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
currentState.GameStageUpdate(GameStages.RESOLVING_ACTIONS);
|
currentState.GameStageUpdate(GameStages.RESOLVING_ACTIONS);
|
||||||
for (Map.Entry<Slot,Player> s : slotMap.entrySet()) {
|
for (Slot s : slotMap.keySet()) {
|
||||||
if (s.getValue()!=null) {
|
if (slotMap.get(s) != null) {
|
||||||
currentState.PlayerUpdate(s.getValue(), s.getKey());
|
currentState.PlayerUpdate(slotMap.get(s), s);
|
||||||
return;
|
if(!((currentState.getNLower() ==0 ||( getLowerListTribeCards().size()==0 && getLowerListBuilding().size()==0)) && ((currentState.getNUpper() ==0)||( getUpperListTribeCards().size()==0 && getUpperListBuilding().size()==0))))
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
orderLogicCard.push(currentState.getCurrentPlayer());
|
||||||
|
slotMap.put(currentState.getSlot(), null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -570,7 +575,15 @@ public class Game implements Serializable {
|
|||||||
for (Slot s : slotMap.keySet()) {
|
for (Slot s : slotMap.keySet()) {
|
||||||
if (slotMap.get(s) != null) {
|
if (slotMap.get(s) != null) {
|
||||||
currentState.PlayerUpdate(slotMap.get(s), s);
|
currentState.PlayerUpdate(slotMap.get(s), s);
|
||||||
break;
|
if((currentState.getNLower() ==0 ||( getLowerListTribeCards().size()==0 && getLowerListBuilding().size()==0)) && ((currentState.getNUpper() ==0)||( getUpperListTribeCards().size()==0 && getUpperListBuilding().size()==0))) {
|
||||||
|
orderLogicCard.push(currentState.getCurrentPlayer());
|
||||||
|
|
||||||
|
slotMap.put(currentState.getSlot(), null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(slotMap.values().stream().allMatch(v -> v == null))
|
if(slotMap.values().stream().allMatch(v -> v == null))
|
||||||
|
|||||||
Reference in New Issue
Block a user