Merge branch 'main' into javadoc-fixes
This commit is contained in:
@@ -41,6 +41,8 @@ public class Board implements Serializable {
|
||||
/** Contains all the building cards of the upper list. When a new era starts, the old era's buildings are moved from the upper to the lower list */
|
||||
public List<BuildingCard> lowerListBuilding;
|
||||
|
||||
|
||||
private final ArrayList<List<BuildingCard>> buildingCardsAllEras;
|
||||
/** Number of players */
|
||||
private int nTotem;
|
||||
|
||||
@@ -88,6 +90,7 @@ public class Board implements Serializable {
|
||||
tribeDeck=generateTribeDeck(nTotem);
|
||||
era=1;
|
||||
|
||||
|
||||
for(int i=0;i<nTotem+1;i++)
|
||||
{
|
||||
TribeCard tempCard = tribeDeck.remove();
|
||||
@@ -110,10 +113,44 @@ 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)));
|
||||
upperListBuilding = new ArrayList<>(buildingDeck.subList(0,1));
|
||||
}
|
||||
else
|
||||
{
|
||||
buildingCardsAllEras.set(0, new ArrayList<>(buildingDeck.subList(0, 2)));
|
||||
upperListBuilding = new ArrayList<>(buildingDeck.subList(0,2));
|
||||
}
|
||||
|
||||
buildingDeck=new ArrayList<>(DecksCreator.loadBuildingDeckByEra(2));
|
||||
Collections.shuffle(buildingDeck);
|
||||
if(nTotem<=3)
|
||||
{
|
||||
buildingCardsAllEras.set(1, new ArrayList<BuildingCard>(buildingDeck.subList(0, 2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
buildingCardsAllEras.set(1, new ArrayList<BuildingCard>(buildingDeck.subList(0, 3)));
|
||||
}
|
||||
buildingDeck=new ArrayList<>(DecksCreator.loadBuildingDeckByEra(3));
|
||||
Collections.shuffle(buildingDeck);
|
||||
if(nTotem==2)
|
||||
{
|
||||
buildingCardsAllEras.set(2, new ArrayList<BuildingCard>(buildingDeck.subList(0, 3)));
|
||||
}else if(nTotem==5)
|
||||
{
|
||||
buildingCardsAllEras.set(2, new ArrayList<BuildingCard>(buildingDeck.subList(0, 5)));
|
||||
}
|
||||
else {
|
||||
buildingCardsAllEras.set(2, new ArrayList<BuildingCard>(buildingDeck.subList(0, 4)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,27 +268,11 @@ public class Board implements Serializable {
|
||||
Collections.shuffle(buildingCards);
|
||||
if(era==2)
|
||||
{
|
||||
if(nTotem<=3)
|
||||
{
|
||||
upperListBuilding.addAll(buildingCards.subList(0,2));
|
||||
}
|
||||
else
|
||||
{
|
||||
upperListBuilding.addAll( buildingCards.subList(0,3));
|
||||
}
|
||||
upperListBuilding.addAll(buildingCardsAllEras.get(1));
|
||||
}
|
||||
else // Era 3
|
||||
else
|
||||
{
|
||||
if(nTotem==2)
|
||||
{
|
||||
upperListBuilding.addAll( buildingCards.subList(0,3));
|
||||
}else if(nTotem==5)
|
||||
{
|
||||
upperListBuilding.addAll( buildingCards.subList(0,5));
|
||||
}
|
||||
else {
|
||||
upperListBuilding.addAll(buildingCards.subList(0,4));
|
||||
}
|
||||
upperListBuilding.addAll(buildingCardsAllEras.get(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ package it.polimi.ingsw.gc14.Model.GamePackage;
|
||||
* Represents the possible stages of a game.
|
||||
*/
|
||||
public enum GameStages {
|
||||
WAITING, SLOT_CHOICE, RESOLVING_ACTIONS, OPTIONAL_CARD_EFFECT, RESOLVING_EVENT, ENDING, ENDED
|
||||
WAITING, SLOT_CHOICE, RES_ACTIONS, OPT_CARD_E, RES_EVENT, ENDING, ENDED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user