Record Class GotHit
java.lang.Object
java.lang.Record
dev.zwazel.internal.message.data.tank.GotHit
- Record Components:
shooterEntity
- The entity that shot the projectileprojectileEntity
- The entity of the projectile that hit this clienthitSide
- The side of this client that was hitdamageReceived
- The amount of damage that was received
- All Implemented Interfaces:
MessageData
public record GotHit(long shooterEntity, long projectileEntity, Side hitSide, float damageReceived)
extends Record
implements MessageData
Represents the data of a hit message.
We receive this message when this client gets hit by a projectile.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Returns the value of thedamageReceived
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.hitSide()
Returns the value of thehitSide
record component.long
Returns the value of theprojectileEntity
record component.long
Returns the value of theshooterEntity
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
-
GotHit
Creates an instance of aGotHit
record class.- Parameters:
shooterEntity
- the value for theshooterEntity
record componentprojectileEntity
- the value for theprojectileEntity
record componenthitSide
- the value for thehitSide
record componentdamageReceived
- the value for thedamageReceived
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. -
shooterEntity
public long shooterEntity()Returns the value of theshooterEntity
record component.- Returns:
- the value of the
shooterEntity
record component
-
projectileEntity
public long projectileEntity()Returns the value of theprojectileEntity
record component.- Returns:
- the value of the
projectileEntity
record component
-
hitSide
-
damageReceived
public float damageReceived()Returns the value of thedamageReceived
record component.- Returns:
- the value of the
damageReceived
record component
-