Record Class PlayerInput
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.platform.PlayerInput
public record PlayerInput(boolean forward, boolean backward, boolean left, boolean right, boolean jump, boolean sneak, boolean sprint)
extends Record
The movement keys a player holds this tick.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerInput(boolean forward, boolean backward, boolean left, boolean right, boolean jump, boolean sneak, boolean sprint) Creates an instance of aPlayerInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbackward()Returns the value of thebackwardrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanforward()Returns the value of theforwardrecord component.final inthashCode()Returns a hash code value for this object.booleanjump()Returns the value of thejumprecord component.booleanleft()Returns the value of theleftrecord component.booleanright()Returns the value of therightrecord component.booleansneak()Returns the value of thesneakrecord component.booleansprint()Returns the value of thesprintrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlayerInput
public PlayerInput(boolean forward, boolean backward, boolean left, boolean right, boolean jump, boolean sneak, boolean sprint) Creates an instance of aPlayerInputrecord class.- Parameters:
forward- the value for theforwardrecord componentbackward- the value for thebackwardrecord componentleft- the value for theleftrecord componentright- the value for therightrecord componentjump- the value for thejumprecord componentsneak- the value for thesneakrecord componentsprint- the value for thesprintrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
forward
public boolean forward()Returns the value of theforwardrecord component.- Returns:
- the value of the
forwardrecord component
-
backward
public boolean backward()Returns the value of thebackwardrecord component.- Returns:
- the value of the
backwardrecord component
-
left
public boolean left()Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
public boolean right()Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
jump
public boolean jump()Returns the value of thejumprecord component.- Returns:
- the value of the
jumprecord component
-
sneak
public boolean sneak()Returns the value of thesneakrecord component.- Returns:
- the value of the
sneakrecord component
-
sprint
public boolean sprint()Returns the value of thesprintrecord component.- Returns:
- the value of the
sprintrecord component
-