Add: endGame To Complete

This commit is contained in:
GabrieleRadice
2026-03-27 18:41:48 +01:00
parent 72c219da5a
commit a36e514501
2 changed files with 14 additions and 14 deletions
@@ -349,16 +349,16 @@ public class Game {
currentState.RoundUpdate();
}
// TODO pulire game ?
private void endGame() {
//DO SOMETHING THEN
for(Player p : playersList){
List<BuildingCard> cards = p.buildingCards.stream().
filter(x -> x.getEffectType() == EffectType.FINAL).toList();
}
playersList.forEach(
p -> p.buildingCards.stream().filter(x -> x.getEffectType() == EffectType.FINAL).
forEach(x -> x.applyEffect(p))
);
currentState.GameStageUpdate(GameStages.ENDED);
}
// TODO endGame, optional cards,
@@ -5,7 +5,7 @@ import it.polimi.ingsw.gc14.Model.Slot;
import it.polimi.ingsw.gc14.Model.GamePackage.GameStages;
public class CurrentState {
// Getters
// region Getters
private Player player;
public Player getCurrentPlayer(){
return player;
@@ -41,9 +41,9 @@ public class CurrentState {
return GameStage;
}
// End getters
// endregion getters
// Setters
// region Setters
public void EraUpdate(){
Era++;
}
@@ -63,9 +63,9 @@ public class CurrentState {
public void GameStageUpdate(GameStages GameStage){
this.GameStage = GameStage;
}
// End setters
// endregion setters
// Constructors
// region Constructors
public CurrentState(){
this.player = null;
this.slot = null;
@@ -74,14 +74,14 @@ public class CurrentState {
this.NLower = 0;
this.GameStage = GameStages.WAITING;
}
// End constructors
// endregion constructors
// Functions
// region Functions
public void PlayerUpdate(Player player, Slot slot){
this.player = player;
this.slot = slot;
this.NUpper = slot.getNUpper();
this.NLower = slot.getNLower();
}
// End functions
// endregion functions
}