Interface GamePiece

All Known Implementing Classes:
CrescendoNoteOnField, GamePieceOnFieldSimulation, GamePieceProjectile, NoteOnFly, RebuiltFuelOnField, RebuiltFuelOnFly, ReefscapeAlgaeOnField, ReefscapeAlgaeOnFly, ReefscapeCoralAlgaeStack, ReefscapeCoralOnField, ReefscapeCoralOnFly

public interface GamePiece

Interface for all Game pieces.

This class contains basic functions all game pieces will have so that game pieces of different types can be used interchangeably in collision detection.

  • Method Summary

    Modifier and Type
    Method
    Description
    Gives the pose3d of a game piece.
    Gives the string type of the current game piece.
    Gives the velocity of the game piece.
    boolean
    Gives wether or not the piece is "grounded".
    void
    Internal function called to trigger a callback whenever this game piece is scored in a goal
  • Method Details

    • getPose3d

      Pose3d getPose3d()

      Gives the pose3d of a game piece.

      Returns:
      The pose of this piece as a Pose3d.
    • getType

      String getType()

      Gives the string type of the current game piece.

      Returns:
      The game piece string type (ex "Coral", "Algae", "Note").
    • getVelocity3dMPS

      Translation3d getVelocity3dMPS()

      Gives the velocity of the game piece.

      For grounded game pieces the z access velocity does not exist and so will be set to 0 automatically.
      Returns:
      The velocity of the game piece as a Translation3d.
    • triggerHitTargeCallBack

      void triggerHitTargeCallBack()

      Internal function called to trigger a callback whenever this game piece is scored in a goal

    • isGrounded

      boolean isGrounded()

      Gives wether or not the piece is "grounded".

      A grounded piece is likely a child of GamePieceOnFieldSimulation while a non grounded piece is likely a child ofGamePieceProjectile.
      Returns:
      wether or not the piece is grounded.