Removed: Board in ApplyNextRound, MiniModel constructor

Added: upperListTribe,lowerListTribe,upperListBuilding,lowerListBuilding in MiniModel constructor
This commit is contained in:
rubenpirreram
2026-05-19 18:28:05 +02:00
parent d37c111c3c
commit 6da5670dff
10 changed files with 58 additions and 44 deletions
@@ -265,8 +265,8 @@ public class Game implements Serializable {
*
* @return a list containing clones of the upper tribe cards currently available on the board.
*/
public List<TribeCard>getUpperListTribeCards() {
List<TribeCard> cards = new ArrayList<>();
public ArrayList<TribeCard>getUpperListTribeCards() {
ArrayList<TribeCard> cards = new ArrayList<>();
board.upperListTribe.forEach(x->cards.add(x.clone()));
return cards;
}
@@ -276,8 +276,8 @@ public class Game implements Serializable {
*
* @return a list containing clones of the lower tribe cards currently available on the board.
*/
public List<TribeCard>getLowerListTribeCards() {
List<TribeCard> cards = new ArrayList<>();
public ArrayList<TribeCard>getLowerListTribeCards() {
ArrayList<TribeCard> cards = new ArrayList<>();
board.lowerListTribe.forEach(x->cards.add(x.clone()));
return cards;
}
@@ -287,8 +287,8 @@ public class Game implements Serializable {
*
* @return a list containing clones of the upper building cards currently available on the board.
*/
public List<BuildingCard>getUpperListBuilding() {
List<BuildingCard> cards = new ArrayList<>();
public ArrayList<BuildingCard>getUpperListBuilding() {
ArrayList<BuildingCard> cards = new ArrayList<>();
board.upperListBuilding.forEach(x->cards.add(x.clone()));
return cards;
}
@@ -298,8 +298,8 @@ public class Game implements Serializable {
*
* @return a list containing clones of the lower building cards currently available on the board.
*/
public List<BuildingCard>getLowerListBuilding() {
List<BuildingCard> cards = new ArrayList<>();
public ArrayList<BuildingCard>getLowerListBuilding() {
ArrayList<BuildingCard> cards = new ArrayList<>();
board.lowerListBuilding.forEach(x->cards.add(x.clone()));
return cards;
}
@@ -69,26 +69,29 @@ public class MiniModel implements Serializable {
/**
* Constructs a complete mini model from the current server-side game data.
*
* @param board the current game board.
*TODO
* @param slotPlayerMap the map associating occupied slots with players.
* @param orderLogicCard the card managing player turn order.
* @param currentState the current state of the game.
* @param players the list of players in the match.
* @param availableTotems the list of totems still available for selection.
*/
public MiniModel(Board board,
Map<Slot, Player> slotPlayerMap,
public MiniModel(Map<Slot, Player> slotPlayerMap,
OrderLogicCard orderLogicCard,
CurrentState currentState,
List<Player> players,
List<Totems> availableTotems) {
this.board = board;
List<Totems> availableTotems,ArrayList<TribeCard> upperListTribeCards,ArrayList<TribeCard>lowerListTribeCards,ArrayList<BuildingCard> upperListBuildingCards,ArrayList<BuildingCard>lowerListBuildingCards) {
this.slotPlayerMap = slotPlayerMap;
this.orderLogicCard = orderLogicCard;
this.currentState = currentState;
this.players = new HashMap<>();
this.availableTotems = availableTotems;
this.standingPlayers = new ArrayList<>();
this.upperListTribeCards = upperListTribeCards;
this.lowerListTribeCards = lowerListTribeCards;
this.upperListBuildingCards = upperListBuildingCards;
this.lowerListBuildingCards = lowerListBuildingCards;
setPlayers(players);
}