Record Class GameState
java.lang.Object
java.lang.Record
dev.zwazel.internal.message.data.GameState
- Record Components:
 tick- The tick at which this state was recorded.score- The score of each team.clientStates- The state of each client.projectileStates- The state of each projectile.flagStates- The state of each flag.flagBaseStates- The state of each flag base.
- All Implemented Interfaces:
 MessageData
public record GameState(Long tick, HashMap<String,Long> score, HashMap<Long,ClientState> clientStates, HashMap<Long,ProjectileState> projectileStates, HashMap<Long,FlagGameState> flagStates, HashMap<Long,FlagBaseState> flagBaseStates)
extends Record
implements MessageData     
Represents the state of the game at a given tick.
- 
Constructor Summary
ConstructorsConstructorDescriptionGameState(Long tick, HashMap<String, Long> score, HashMap<Long, ClientState> clientStates, HashMap<Long, ProjectileState> projectileStates, HashMap<Long, FlagGameState> flagStates, HashMap<Long, FlagBaseState> flagBaseStates) Creates an instance of aGameStaterecord class. - 
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyOnReceive(InternalGameWorld internalWorld) Applies to the world when receivedReturns the value of theclientStatesrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theflagBaseStatesrecord component.Returns the value of theflagStatesrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theprojectileStatesrecord component.score()Returns the value of thescorerecord component.tick()Returns the value of thetickrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.zwazel.internal.message.MessageData
applyBeforeSend, applyOnAddingToQueue, isUnique 
- 
Constructor Details
- 
GameState
public GameState(Long tick, HashMap<String, Long> score, HashMap<Long, ClientState> clientStates, HashMap<Long, ProjectileState> projectileStates, HashMap<Long, FlagGameState> flagStates, HashMap<Long, FlagBaseState> flagBaseStates) Creates an instance of aGameStaterecord class.- Parameters:
 tick- the value for thetickrecord componentscore- the value for thescorerecord componentclientStates- the value for theclientStatesrecord componentprojectileStates- the value for theprojectileStatesrecord componentflagStates- the value for theflagStatesrecord componentflagBaseStates- the value for theflagBaseStatesrecord component
 
 - 
 - 
Method Details
- 
applyOnReceive
Description copied from interface:MessageDataApplies to the world when received- Specified by:
 applyOnReceivein interfaceMessageData- Parameters:
 internalWorld- the world- Returns:
 - if true, we add it to the Input Queue, so Bots can read them. If false, we don't.
 
 - 
toString
 - 
hashCode
 - 
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). - 
tick
 - 
score
 - 
clientStates
Returns the value of theclientStatesrecord component.- Returns:
 - the value of the 
clientStatesrecord component 
 - 
projectileStates
Returns the value of theprojectileStatesrecord component.- Returns:
 - the value of the 
projectileStatesrecord component 
 - 
flagStates
Returns the value of theflagStatesrecord component.- Returns:
 - the value of the 
flagStatesrecord component 
 - 
flagBaseStates
Returns the value of theflagBaseStatesrecord component.- Returns:
 - the value of the 
flagBaseStatesrecord component 
 
 -