Record Class GameOverEvent
java.lang.Object
java.lang.Record
it.polimi.ingsw.Server.Messages.Events.Internal.GameOverEvent
- All Implemented Interfaces:
ClientEvent
This Event is generated when a lobby's game is detected to have ended. It is always spawned AFTER a
ModelUpdateEvent
in the ModelWrapper.editModel(it.polimi.ingsw.Model.ModelWrapper.ModelModifier, boolean)
method-
Field Summary
-
Constructor Summary
ConstructorDescriptionGameOverEvent
(List<String> winners) Creates an instance of aGameOverEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.winners()
Returns the value of thewinners
record component.
-
Field Details
-
winners
The field for thewinners
record component.
-
-
Constructor Details
-
GameOverEvent
Creates an instance of aGameOverEvent
record class.- Parameters:
winners
- the value for thewinners
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
winners
Returns the value of thewinners
record component.- Returns:
- the value of the
winners
record component
-