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 TypeMethodDescriptionfloatReturns the value of thedamageDealtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thehitEntityrecord component.hitSide()Returns the value of thehitSiderecord component.longReturns the value of theprojectileEntityrecord 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, applyOnReceive, isUnique
-
Constructor Details
-
Hit
Creates an instance of aHitrecord class.- Parameters:
hitEntity- the value for thehitEntityrecord componentprojectileEntity- the value for theprojectileEntityrecord componenthitSide- the value for thehitSiderecord componentdamageDealt- the value for thedamageDealtrecord 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 thecomparemethod from their corresponding wrapper classes. -
hitEntity
-
projectileEntity
public long projectileEntity()Returns the value of theprojectileEntityrecord component.- Returns:
- the value of the
projectileEntityrecord component
-
hitSide
-
damageDealt
public float damageDealt()Returns the value of thedamageDealtrecord component.- Returns:
- the value of the
damageDealtrecord component
-