From 60c45d5333a4d929367bbe9c6abf05fd52b5d7e7 Mon Sep 17 00:00:00 2001 From: AleandroPagani Date: Sat, 11 Apr 2026 16:05:14 +0200 Subject: [PATCH] Fix: small changes to Board --- .../ingsw/gc14/Model/GamePackage/Board.java | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java b/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java index 71a772a..764eb47 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java @@ -74,7 +74,7 @@ public class Board { tribeDeck=getTribeDeck(nTotem); era=1; - for(int i=0;i(EventCard)x).collect(Collectors.toCollection(LinkedList::new)); } - - // TODO chiedere a ruben che cazzo sono sti metodi + /** + * Take the selected card from the upper tribe list of the board + * + * @param tribeCard is the card to remove + * @return true if succeed in removing the card + */ public boolean removeUpperTribeCard(TribeCard tribeCard) { return upperListTribe.remove(tribeCard); } + /** + * Take the selected card from the lower tribe list of the board + * + * @param tribeCard is the card to remove + * @return true if succeed in removing the card + */ public boolean removeLowerTribeCard(TribeCard tribeCard) { - return upperListTribe.remove(tribeCard); + return lowerListTribe.remove(tribeCard); } + /** + * Take the selected card from the upper building list of the board + * + * @param buildingCard is the card to remove + * @return true if succeed in removing the card + */ public boolean removeUpperBuildingCard(BuildingCard buildingCard) { - return upperListTribe.remove(buildingCard); + return upperListBuilding.remove(buildingCard); } + /** + * Take the selected card from the lower building list of the board + * + * @param buildingCard is the card to remove + * @return true if succeed in removing the card + */ public boolean removeLowerBuildingCard(BuildingCard buildingCard) { - return upperListTribe.remove(buildingCard); + return lowerListBuilding.remove(buildingCard); } /** @@ -160,7 +182,6 @@ public class Board { * - Populate the upper tribe row * */ - // TODO chiedere a che serve il secondo for a ruben public int nextRound() { lowerListTribe.clear(); lowerListTribe.addAll(upperListTribe); @@ -174,24 +195,23 @@ public class Board { } upperListTribe.add(tempCard); } - for(int i=upperListTribe.size();i buildingCards=DecksCreator.loadBuildingDeckByEra(era); + ArrayList buildingCards= new ArrayList<>(DecksCreator.loadBuildingDeckByEra(era)); Collections.shuffle(buildingCards); if(era==2) {