Class TractorActions

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tractor.TractorActions
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable

public class TractorActions extends Component
  • Constructor Details

    • TractorActions

      public TractorActions()
  • Method Details

    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class Component
    • update

      public void update()
      Description copied from class: Component
      Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
      Overrides:
      update in class Component
    • stopMoving

      public void stopMoving()
      Stops the player from walking.
    • isMoving

      public boolean isMoving()
      Checks if the player/tractor is moving.
      Returns:
      true if moving else false
    • isMuted

      public boolean isMuted()
      When in the tractor inputs should be muted, this handles that.
      Returns:
      if the players inputs should be muted
    • setMuted

      public void setMuted(boolean muted)
      Sets the tractor's actions to be muted, This should be done when exiting the tractor.
      Parameters:
      muted -
    • getMode

      public TractorMode getMode()
      Returns tractor mode the tractor is currently using
      Returns:
      the TractorMode value for the mode of the Tractor entity
    • setMode

      public void setMode(TractorMode mode)
      Sets the mode of the tractor entity to a given mode
      Parameters:
      mode - The TractorMode to set the mode to
    • write

      public void write(com.badlogic.gdx.utils.Json json)
      Writes to the json in order to store the tractor's state, used to save the game
      Specified by:
      write in interface com.badlogic.gdx.utils.Json.Serializable
      Overrides:
      write in class Component
      Parameters:
      json - The json that will be converted to a file