Fixed: Building Shuffle Init
This commit is contained in:
@@ -640,7 +640,7 @@ public class Game implements Serializable {
|
||||
{
|
||||
currentState.GameStageUpdate(GameStages.OPTIONAL_CARD_EFFECT);
|
||||
HashMap<Player,Integer> optional=new LinkedHashMap<>();
|
||||
for (Player p : playersList) {
|
||||
for (Player p : orderLogicCard.players) {
|
||||
int tempCount=(int)p.buildingCards.stream().filter(x->x.getEffectId()==12).count();
|
||||
if(tempCount>0)
|
||||
{
|
||||
|
||||
@@ -114,6 +114,9 @@ public class Board implements Serializable {
|
||||
ArrayList<BuildingCard> buildingDeck = new ArrayList<>(DecksCreator.loadBuildingDeckByEra(1));
|
||||
Collections.shuffle(buildingDeck);
|
||||
buildingCardsAllEras= new ArrayList<>();
|
||||
buildingCardsAllEras.add(new ArrayList<>());
|
||||
buildingCardsAllEras.add(new ArrayList<>());
|
||||
buildingCardsAllEras.add(new ArrayList<>());
|
||||
if(nTotem==2)
|
||||
{
|
||||
buildingCardsAllEras.set(0, new ArrayList<>(buildingDeck.subList(0, 1)));
|
||||
|
||||
@@ -149,7 +149,7 @@ class BoardTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("RemgetTribeDeckSizeoving a card from upper row of building cards")
|
||||
@DisplayName("Removing a card from upper row of building cards")
|
||||
void removeUpperBuildingCard() {
|
||||
Board bd = new Board(3);
|
||||
|
||||
@@ -214,6 +214,8 @@ class BoardTest {
|
||||
assertEquals(upperListBefore, bd1.lowerListBuilding);
|
||||
assertNotEquals(upperListBefore, bd1.upperListBuilding);
|
||||
assertEquals(2, bd1.upperListBuilding.size());
|
||||
assertTrue(bd1.upperListBuilding.stream().allMatch(x->x.getEra()==2));
|
||||
assertTrue(bd1.lowerListBuilding.stream().allMatch(x->x.getEra()==1));
|
||||
|
||||
|
||||
// Era 2, nTotem > 3
|
||||
@@ -227,7 +229,8 @@ class BoardTest {
|
||||
assertEquals(upperListBefore, bd2.lowerListBuilding);
|
||||
assertNotEquals(upperListBefore, bd2.upperListBuilding);
|
||||
assertEquals(3, bd2.upperListBuilding.size());
|
||||
|
||||
assertTrue(bd2.upperListBuilding.stream().allMatch(x->x.getEra()==2));
|
||||
assertTrue(bd2.lowerListBuilding.stream().allMatch(x->x.getEra()==1));
|
||||
|
||||
// Era 3, nTotem == 2
|
||||
numPlayer = 2;
|
||||
@@ -243,6 +246,8 @@ class BoardTest {
|
||||
assertEquals(upperListBefore, bd3.lowerListBuilding);
|
||||
assertNotEquals(upperListBefore, bd3.upperListBuilding);
|
||||
assertEquals(3, bd3.upperListBuilding.size());
|
||||
assertTrue(bd3.upperListBuilding.stream().allMatch(x->x.getEra()==3));
|
||||
assertTrue(bd3.lowerListBuilding.stream().allMatch(x->x.getEra()==2));
|
||||
|
||||
|
||||
// Era 3, nTotem == 5
|
||||
@@ -259,6 +264,8 @@ class BoardTest {
|
||||
assertEquals(upperListBefore, bd4.lowerListBuilding);
|
||||
assertNotEquals(upperListBefore, bd4.upperListBuilding);
|
||||
assertEquals(5, bd4.upperListBuilding.size());
|
||||
assertTrue(bd4.upperListBuilding.stream().allMatch(x->x.getEra()==3));
|
||||
assertTrue(bd4.lowerListBuilding.stream().allMatch(x->x.getEra()==2));
|
||||
|
||||
|
||||
// Era 3, nTotem != 2, 5
|
||||
@@ -275,6 +282,8 @@ class BoardTest {
|
||||
assertEquals(upperListBefore, bd5.lowerListBuilding);
|
||||
assertNotEquals(upperListBefore, bd5.upperListBuilding);
|
||||
assertEquals(4, bd5.upperListBuilding.size());
|
||||
assertTrue(bd5.upperListBuilding.stream().allMatch(x->x.getEra()==3));
|
||||
assertTrue(bd5.lowerListBuilding.stream().allMatch(x->x.getEra()==2));
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user