Class EndedGame
java.lang.Object
it.polimi.ingsw.gc14.Network.NetworkEvent
it.polimi.ingsw.gc14.Network.NetworkEvents.EndedGame
- All Implemented Interfaces:
Serializable
Network event that signals the end of the game and delivers the final standings.
Only applied client-side; apply(GameController) always returns false.
- See Also:
-
Field Summary
Fields inherited from class NetworkEvent
currentState, disconnectedPlayers, errorType, eventType, isError, orderLogicCard, playerList, slotPlayerMap, username -
Constructor Summary
ConstructorsConstructorDescriptionEndedGame(Map<Slot, Player> slotPlayerMap, OrderLogicCard orderLogicCard, CurrentState currentState, ArrayList<Player> players) Constructs an event containing the final game state. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(GameController gameController) Not applicable server-side.voidApplies this event to the client-side mini model, updating the final game state and setting the standings list for the leaderboard.Methods inherited from class NetworkEvent
enrichWithGameState, getErrorType, getEventType, getUsername, isError, setData, setErrorType, setIsError, toString
-
Constructor Details
-
EndedGame
public EndedGame(Map<Slot, Player> slotPlayerMap, OrderLogicCard orderLogicCard, CurrentState currentState, ArrayList<Player> players) Constructs an event containing the final game state.- Parameters:
slotPlayerMap- the map associating each slot with the player occupying it.orderLogicCard- the order logic card that determines the player order.currentState- the current state of the game.players- the final list of players, used as the standings.
-
-
Method Details
-
apply
Not applicable server-side.- Specified by:
applyin classNetworkEvent- Parameters:
gameController- the game controller (unused).- Returns:
falsealways.
-
apply
Applies this event to the client-side mini model, updating the final game state and setting the standings list for the leaderboard.- Specified by:
applyin classNetworkEvent- Parameters:
miniModel- the client-side model to update.
-