Record Class ClientState
java.lang.Object
java.lang.Record
dev.zwazel.internal.game.state.ClientState
- Record Components:
 id- The id of the clienttransformBody- The transform of the body of the tanktransformTurret- The transform of the turret of the tank (relative to the body)state- The state of the player (e.g. alive, dead)shootCooldown- The amount of ticks until the tank can shoot againcurrentHealth- The current health of the tank
public record ClientState(long id, Transform transformBody, Transform transformTurret, ClientState.PlayerState state, long shootCooldown, float currentHealth)
extends Record
Represents the state of a client in the game.
- 
Nested Class Summary
Nested Classes - 
Constructor Summary
ConstructorsConstructorDescriptionClientState(long id, Transform transformBody, Transform transformTurret, ClientState.PlayerState state, long shootCooldown, float currentHealth) Creates an instance of aClientStaterecord class. - 
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thecurrentHealthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longid()Returns the value of theidrecord component.longReturns the value of theshootCooldownrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformBodyrecord component.Returns the value of thetransformTurretrecord component. 
- 
Constructor Details
- 
ClientState
public ClientState(long id, Transform transformBody, Transform transformTurret, ClientState.PlayerState state, long shootCooldown, float currentHealth) Creates an instance of aClientStaterecord class.- Parameters:
 id- the value for theidrecord componenttransformBody- the value for thetransformBodyrecord componenttransformTurret- the value for thetransformTurretrecord componentstate- the value for thestaterecord componentshootCooldown- the value for theshootCooldownrecord componentcurrentHealth- the value for thecurrentHealthrecord component
 
 - 
 - 
Method Details
- 
getConnectedClientConfig
 - 
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. - 
id
 - 
transformBody
Returns the value of thetransformBodyrecord component.- Returns:
 - the value of the 
transformBodyrecord component 
 - 
transformTurret
Returns the value of thetransformTurretrecord component.- Returns:
 - the value of the 
transformTurretrecord component 
 - 
state
 - 
shootCooldown
public long shootCooldown()Returns the value of theshootCooldownrecord component.- Returns:
 - the value of the 
shootCooldownrecord component 
 - 
currentHealth
public float currentHealth()Returns the value of thecurrentHealthrecord component.- Returns:
 - the value of the 
currentHealthrecord component 
 
 -