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 arena
shape - the shape of the collision space for the game piece
gamePieceHeight - the height (thickness) of the game piece, in meters
gamePieceMass - 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

    Constructors
    Constructor
    Description
    GamePieceInfo(String type, org.dyn4j.geometry.Convex shape, Distance gamePieceHeight, Mass gamePieceMass, double linearDamping, double angularDamping, double coefficientOfRestitution)
    Creates an instance of a GamePieceInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the angularDamping record component.
    double
    Returns the value of the coefficientOfRestitution record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the gamePieceHeight record component.
    Returns the value of the gamePieceMass record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the linearDamping record component.
    org.dyn4j.geometry.Convex
    Returns the value of the shape record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a GamePieceInfo record class.
      Parameters:
      type - the value for the type record component
      shape - the value for the shape record component
      gamePieceHeight - the value for the gamePieceHeight record component
      gamePieceMass - the value for the gamePieceMass record component
      linearDamping - the value for the linearDamping record component
      angularDamping - the value for the angularDamping record component
      coefficientOfRestitution - the value for the coefficientOfRestitution record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • shape

      public org.dyn4j.geometry.Convex shape()
      Returns the value of the shape record component.
      Returns:
      the value of the shape record component
    • gamePieceHeight

      public Distance gamePieceHeight()
      Returns the value of the gamePieceHeight record component.
      Returns:
      the value of the gamePieceHeight record component
    • gamePieceMass

      public Mass gamePieceMass()
      Returns the value of the gamePieceMass record component.
      Returns:
      the value of the gamePieceMass record component
    • linearDamping

      public double linearDamping()
      Returns the value of the linearDamping record component.
      Returns:
      the value of the linearDamping record component
    • angularDamping

      public double angularDamping()
      Returns the value of the angularDamping record component.
      Returns:
      the value of the angularDamping record component
    • coefficientOfRestitution

      public double coefficientOfRestitution()
      Returns the value of the coefficientOfRestitution record component.
      Returns:
      the value of the coefficientOfRestitution record component