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 aGamePieceInforecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theangularDampingrecord component.doubleReturns the value of thecoefficientOfRestitutionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegamePieceHeightrecord component.Returns the value of thegamePieceMassrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thelinearDampingrecord component.org.dyn4j.geometry.Convexshape()Returns the value of theshaperecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord 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 aGamePieceInforecord class.- Parameters:
type- the value for thetyperecord componentshape- the value for theshaperecord componentgamePieceHeight- the value for thegamePieceHeightrecord componentgamePieceMass- the value for thegamePieceMassrecord componentlinearDamping- the value for thelinearDampingrecord componentangularDamping- the value for theangularDampingrecord componentcoefficientOfRestitution- the value for thecoefficientOfRestitutionrecord 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 thetyperecord component.- Returns:
- the value of the
typerecord component
-
shape
public org.dyn4j.geometry.Convex shape()Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-
gamePieceHeight
Returns the value of thegamePieceHeightrecord component.- Returns:
- the value of the
gamePieceHeightrecord component
-
gamePieceMass
Returns the value of thegamePieceMassrecord component.- Returns:
- the value of the
gamePieceMassrecord component
-
linearDamping
public double linearDamping()Returns the value of thelinearDampingrecord component.- Returns:
- the value of the
linearDampingrecord component
-
angularDamping
public double angularDamping()Returns the value of theangularDampingrecord component.- Returns:
- the value of the
angularDampingrecord component
-
coefficientOfRestitution
public double coefficientOfRestitution()Returns the value of thecoefficientOfRestitutionrecord component.- Returns:
- the value of the
coefficientOfRestitutionrecord component
-