Module technology.sola.engine
Record Class KeyControlInputCondition
java.lang.Object
java.lang.Record
technology.sola.engine.assets.input.KeyControlInputCondition
- Record Components:
key
- theKey
to checkstate
- theKeyControlInputCondition.State
needed to be considered active
- All Implemented Interfaces:
ControlInputCondition<KeyControlInputCondition.State>
@NullMarked
public record KeyControlInputCondition(Key key, KeyControlInputCondition.State state)
extends Record
implements ControlInputCondition<KeyControlInputCondition.State>
KeyControlInputCondition is a
ControlInputCondition
to check if a Key
is in an active state.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aKeyControlInputCondition
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isActive
(KeyboardInput keyboardInput, MouseInput mouseInput) Checks the state of the input to see if the condition is active or not.key()
Returns the value of thekey
record component.state()
Returns the value of thestate
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
isActive
Description copied from interface:ControlInputCondition
Checks the state of the input to see if the condition is active or not.- Specified by:
isActive
in interfaceControlInputCondition<KeyControlInputCondition.State>
- Parameters:
keyboardInput
- theKeyboardInput
mouseInput
- theMouseInput
- Returns:
- true if the condition is active
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 withObjects::equals(Object,Object)
. -
key
Returns the value of thekey
record component.- Returns:
- the value of the
key
record component
-
state
Returns the value of thestate
record component.- Specified by:
state
in interfaceControlInputCondition<KeyControlInputCondition.State>
- Returns:
- the value of the
state
record component
-