Class BotState

java.lang.Object
com.takenoko.engine.BotState

public class BotState extends Object
This class is used to store the state of a bot.
  • Field Details

  • Constructor Details

    • BotState

      public BotState(Inventory inventory, ObjectiveManager objectiveManager, ActionManager actionManager)
    • BotState

      public BotState()
    • BotState

      public BotState(BotState botState)
      Copy constructor
      Parameters:
      botState - the state to copy
  • Method Details

    • reset

      public void reset()
      reset everything to the default values
    • copy

      public BotState copy()
      make a copy of the current state
      Returns:
      the copy
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • update

      public void update(Board board)
      update the objectives
      Parameters:
      board - the board
    • getEatenBambooCounter

      public int getEatenBambooCounter()
      Returns:
      the number of bamboo eaten by the bot
    • getInventory

      public Inventory getInventory()
      Return the bot inventory
      Returns:
      the bot inventory
    • setNumberOfActions

      public void setNumberOfActions(int numberOfActions)
    • getNumberOfActions

      protected int getNumberOfActions()
      Returns:
      number of actions the bot can do in a turn
    • getAvailableActions

      public List<Class<? extends Action>> getAvailableActions()
      Return the list of available actions. If actions of FORCED type are available, only these actions are returned else all available actions are returned.
      Returns:
      the list of available actions
    • addAvailableAction

      public void addAvailableAction(Class<? extends Action> action)
      add an action to the list of available actions
      Parameters:
      action - the action to add
    • addAction

      public void addAction()
      add an action to the number of actions to plau this turn
    • updateAvailableActions

      public void updateAvailableActions(Action action, ActionResult actionResult)
      update an action in available actions
      Parameters:
      action - the action to update
      actionResult - the result of the action
    • resetAvailableActions

      public void resetAvailableActions(Board board)
      reset the available actions
      Parameters:
      board - the board
    • getAlreadyDoneActions

      public List<Class<? extends Action>> getAlreadyDoneActions()
      get the list of already done actions
      Returns:
      the list of already done actions
    • getObjectives

      public List<Objective> getObjectives()
      Get the current Objectives of the bot
      Returns:
      Objectives
    • addObjective

      public void addObjective(Objective objective)
      Set the current Objective of the bot
      Parameters:
      objective - the objectives
    • getObjectiveScore

      public int getObjectiveScore()
      get the score of the achieved objectives
      Returns:
      the score of the achieved objectives
    • getRedeemedObjectives

      public List<Objective> getRedeemedObjectives()
      Get the list of the redeemed objectives
      Returns:
      the list of the redeemed objectives
    • getAchievedObjectives

      public List<Objective> getAchievedObjectives()
      get the list of achieved objectives
      Returns:
      the list of achieved objectives
    • verifyObjectives

      public void verifyObjectives(Board board)
      for each objective, check if it is achieved
      Parameters:
      board - the board
    • setObjectiveNotAchieved

      public void setObjectiveNotAchieved(Objective objective)
      set an objective as not achieved
      Parameters:
      objective - the objective
    • setObjectiveAchieved

      public void setObjectiveAchieved(Objective objective)
      set an objective as achieved
      Parameters:
      objective - the objective
    • redeemObjective

      public void redeemObjective(Objective objective)
      redeem an objective
      Parameters:
      objective - the objective
    • getPandaObjectiveScore

      public int getPandaObjectiveScore()
      Returns the sum of the points of all the panda objectives
      Returns:
      the sum of the points of all the panda objectives
    • setStartingDeck

      public void setStartingDeck(List<Objective> objectives)
      Set the starting deck
      Parameters:
      objectives - list of objectives
    • getNotAchievedObjectives

      public List<Objective> getNotAchievedObjectives()