Fix: GameTest Partial
This commit is contained in:
@@ -33,6 +33,21 @@ public class Game {
|
||||
board.upperListTribe.forEach(x->cards.add(x.clone()));
|
||||
return cards;
|
||||
}
|
||||
public List<TribeCard>getLowerListTribeCards() {
|
||||
List<TribeCard> cards = new ArrayList<>();
|
||||
board.lowerListTribe.forEach(x->cards.add(x.clone()));
|
||||
return cards;
|
||||
}
|
||||
public List<BuildingCard>getUpperListBuilding() {
|
||||
List<BuildingCard> cards = new ArrayList<>();
|
||||
board.lowerListBuilding.forEach(x->cards.add(x.clone()));
|
||||
return cards;
|
||||
}
|
||||
public List<BuildingCard>getLowerListBuilding() {
|
||||
List<BuildingCard> cards = new ArrayList<>();
|
||||
board.lowerListBuilding.forEach(x->cards.add(x.clone()));
|
||||
return cards;
|
||||
}
|
||||
public CurrentState getCurrentState() {
|
||||
return currentState;
|
||||
};
|
||||
@@ -41,6 +56,11 @@ public class Game {
|
||||
throw new IndexOutOfBoundsException("Player index out of bounds");
|
||||
return playersList.get(playerIndex);
|
||||
}
|
||||
public Player getPlayerByUsername(int playerIndex) throws IndexOutOfBoundsException {
|
||||
if(playerIndex >= playersList.size())
|
||||
throw new IndexOutOfBoundsException("Player index out of bounds");
|
||||
return playersList.get(playerIndex);
|
||||
}
|
||||
|
||||
|
||||
public int getNPlayers() {
|
||||
@@ -157,7 +177,7 @@ public class Game {
|
||||
if(currentState.getNLower() <1)
|
||||
return false;
|
||||
TribeCard tribeCard = board.lowerListTribe.get(cardIndex);
|
||||
if(!tribeCard.IsEventCard())
|
||||
if(tribeCard.IsEventCard())
|
||||
return false;
|
||||
|
||||
Character tempCard = (Character) tribeCard;
|
||||
@@ -305,9 +325,10 @@ public class Game {
|
||||
if(GameStages.RESOLVING_ACTIONS==currentState.getGameStage()) {
|
||||
orderLogicCard.push(currentState.getCurrentPlayer());
|
||||
slotMap.put(currentState.getSlot(), null);
|
||||
for (Slot s : board.getSlotList()) {
|
||||
for (Slot s : slotMap.keySet()) {
|
||||
if (slotMap.get(s) != null) {
|
||||
currentState.PlayerUpdate(slotMap.get(s), s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(slotMap.values().stream().allMatch(v -> v == null))
|
||||
|
||||
Reference in New Issue
Block a user