Class PlantMouseHoverComponent

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

public class PlantMouseHoverComponent extends Component
Component for telling the PlantInfoDisplayComponent when the player has their mouse cursor hovering over a plant.
  • Constructor Details

    • PlantMouseHoverComponent

      public PlantMouseHoverComponent()
  • Method Details

    • setPlantDied

      public void setPlantDied(boolean plantDied)
      Used to signal when the plant has died.
    • isPlantDead

      public boolean isPlantDead()
      Checks if the plant is dead.
      Returns:
      true if the plant is dead, false otherwise.
    • isShowInfo

      public boolean isShowInfo()
      Checks whether plant information is currently being shown.
      Returns:
      true if plant information is being shown, false otherwise.
    • setShowInfo

      public void setShowInfo(boolean showInfo)
      Sets whether plant information is currently being shown.
      Parameters:
      showInfo - true to indicate that plant information is being shown, false otherwise.
    • isNoMoreUse

      public boolean isNoMoreUse()
      Checks whether the plant information should no longer be used.
      Returns:
      true if the plant information should no longer be used, false otherwise.
    • setNoMoreUse

      public void setNoMoreUse(boolean noMoreUse)
      Sets whether the plant information should no longer be used.
      Parameters:
      noMoreUse - true to indicate that the plant information should no longer be used, false otherwise.
    • create

      public void create()
      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()
      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
    • updateInfo

      public void updateInfo()
      Used to update the information being shown in the Plant information widget.