Record Class GamePieceOnFieldSimulation.GamePieceInfo
java.lang.Object
java.lang.Record
org.ironmaple.simulation.gamepieces.GamePieceOnFieldSimulation.GamePieceInfo
- Record Components:
type
- the type of the game piece, affecting categorization within the arenashape
- the shape of the collision space for the game piecegamePieceHeight
- the height (thickness) of the game piece, in metersgamePieceMass
- the mass of the game piece, in kilograms
- Enclosing class:
- GamePieceOnFieldSimulation
public static record GamePieceOnFieldSimulation.GamePieceInfo(String type, org.dyn4j.geometry.Convex shape, Distance gamePieceHeight, Mass gamePieceMass, double linearDamping, double angularDamping, double coefficientOfRestitution)
extends Record
Stores the info of a type of game piece
-
Constructor Summary
ConstructorsConstructorDescriptionGamePieceInfo
(String type, org.dyn4j.geometry.Convex shape, Distance gamePieceHeight, Mass gamePieceMass, double linearDamping, double angularDamping, double coefficientOfRestitution) Creates an instance of aGamePieceInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the value of theangularDamping
record component.double
Returns the value of thecoefficientOfRestitution
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thegamePieceHeight
record component.Returns the value of thegamePieceMass
record component.final int
hashCode()
Returns a hash code value for this object.double
Returns the value of thelinearDamping
record component.org.dyn4j.geometry.Convex
shape()
Returns the value of theshape
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
GamePieceInfo
public GamePieceInfo(String type, org.dyn4j.geometry.Convex shape, Distance gamePieceHeight, Mass gamePieceMass, double linearDamping, double angularDamping, double coefficientOfRestitution) Creates an instance of aGamePieceInfo
record class.- Parameters:
type
- the value for thetype
record componentshape
- the value for theshape
record componentgamePieceHeight
- the value for thegamePieceHeight
record componentgamePieceMass
- the value for thegamePieceMass
record componentlinearDamping
- the value for thelinearDamping
record componentangularDamping
- the value for theangularDamping
record componentcoefficientOfRestitution
- the value for thecoefficientOfRestitution
record component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
shape
public org.dyn4j.geometry.Convex shape()Returns the value of theshape
record component.- Returns:
- the value of the
shape
record component
-
gamePieceHeight
Returns the value of thegamePieceHeight
record component.- Returns:
- the value of the
gamePieceHeight
record component
-
gamePieceMass
Returns the value of thegamePieceMass
record component.- Returns:
- the value of the
gamePieceMass
record component
-
linearDamping
public double linearDamping()Returns the value of thelinearDamping
record component.- Returns:
- the value of the
linearDamping
record component
-
angularDamping
public double angularDamping()Returns the value of theangularDamping
record component.- Returns:
- the value of the
angularDamping
record component
-
coefficientOfRestitution
public double coefficientOfRestitution()Returns the value of thecoefficientOfRestitution
record component.- Returns:
- the value of the
coefficientOfRestitution
record component
-