Record Class Hit
java.lang.Object
java.lang.Record
dev.zwazel.internal.message.data.tank.Hit
- Record Components:
hitEntity
- The entity that was hitprojectileEntity
- The entity of the projectile that hit the entityhitSide
- The side of the entity that was hitdamageDealt
- The amount of damage that was dealt
- All Implemented Interfaces:
MessageData
public record Hit(long hitEntity, long projectileEntity, Side hitSide, float damageDealt)
extends Record
implements MessageData
Represents the data of a hit message.
We receive this message when a projectile, that this client has shot, hits another entity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Returns the value of thedamageDealt
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
Returns the value of thehitEntity
record component.hitSide()
Returns the value of thehitSide
record component.long
Returns the value of theprojectileEntity
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.zwazel.internal.message.MessageData
applyBeforeSend, applyOnAddingToQueue, applyOnReceive, isUnique
-
Constructor Details
-
Hit
Creates an instance of aHit
record class.- Parameters:
hitEntity
- the value for thehitEntity
record componentprojectileEntity
- the value for theprojectileEntity
record componenthitSide
- the value for thehitSide
record componentdamageDealt
- the value for thedamageDealt
record component
-
-
Method Details
-
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 thecompare
method from their corresponding wrapper classes. -
hitEntity
-
projectileEntity
public long projectileEntity()Returns the value of theprojectileEntity
record component.- Returns:
- the value of the
projectileEntity
record component
-
hitSide
-
damageDealt
public float damageDealt()Returns the value of thedamageDealt
record component.- Returns:
- the value of the
damageDealt
record component
-