Module technology.sola.engine
Record Class MouseButtonControlInputCondition
java.lang.Object
java.lang.Record
technology.sola.engine.assets.input.MouseButtonControlInputCondition
- Record Components:
- the
MouseButton
to checkstate
- theMouseButtonControlInputCondition.State
needed to be considered active
- All Implemented Interfaces:
ControlInputCondition<MouseButtonControlInputCondition.State>
@NullMarked
public record MouseButtonControlInputCondition(MouseButton button, MouseButtonControlInputCondition.State state)
extends Record
implements ControlInputCondition<MouseButtonControlInputCondition.State>
MouseButtonInputCondition is a
ControlInputCondition
to check if a MouseButton
is in an active state.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The possible states forMouseButtonControlInputCondition
. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aMouseButtonControlInputCondition
record class. -
Method Summary
Modifier and TypeMethodDescriptionbutton()
Returns the value of thebutton
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.boolean
isActive
(KeyboardInput keyboardInput, MouseInput mouseInput) Checks the state of the input to see if the condition is active or not.state()
Returns the value of thestate
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MouseButtonControlInputCondition
public MouseButtonControlInputCondition(MouseButton button, MouseButtonControlInputCondition.State state) Creates an instance of aMouseButtonControlInputCondition
record class.
-
-
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<MouseButtonControlInputCondition.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)
. -
button
Returns the value of thebutton
record component.- Returns:
- the value of the
button
record component
-
state
Returns the value of thestate
record component.- Specified by:
state
in interfaceControlInputCondition<MouseButtonControlInputCondition.State>
- Returns:
- the value of the
state
record component
-