Class BotManager

java.lang.Object
com.takenoko.engine.BotManager

public class BotManager extends Object
This class is used to manage one bot.
  • name
  • objective
  • number of actions
  • bamboos eaten counter
  • Field Details

    • DEFAULT_CONSOLE_USER_INTERFACE

      private static final ConsoleUserInterface DEFAULT_CONSOLE_USER_INTERFACE
    • DEFAULT_NAME

      private static final String DEFAULT_NAME
      See Also:
    • DEFAULT_BOT

      private static final Bot DEFAULT_BOT
    • consoleUserInterface

      private final ConsoleUserInterface consoleUserInterface
    • botState

      private final BotState botState
    • name

      private final String name
    • bot

      private final Bot bot
    • defaultNumberOfActions

      private final int defaultNumberOfActions
    • singleBotStatistics

      private final SingleBotStatistics singleBotStatistics
    • uniqueID

      private final UUID uniqueID
  • Constructor Details

    • BotManager

      public BotManager(ConsoleUserInterface consoleUserInterface, String name, Bot bot, BotState botState, SingleBotStatistics botStatistics)
      Constructor for the class
      Parameters:
      consoleUserInterface - the console user interface
      name - the name of the bot
      bot - the bot
      botState - the bot state
      botStatistics - the extended statistics for this botManager
    • BotManager

      public BotManager()
      Default constructor for the class
    • BotManager

      public BotManager(Bot bot)
      Constructor for the class but this time specifying which bot algorithm must be used
      Parameters:
      bot - the bot
    • BotManager

      public BotManager(Bot bot, String name)
  • Method Details

    • getUniqueID

      public UUID getUniqueID()
    • playBot

      public void playBot(Board board, History history)
      Ask for the bot to choose an action based on his algorithm and then execute the returned action. Objectives are also verified in order to know if the bot has won.
      Parameters:
      board - the board of the game
      history - the history of the game
    • displayDebugBotState

      private void displayDebugBotState()
      Display debug messages
    • canPlayBot

      private boolean canPlayBot()
    • getNumberOfActions

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

      public void displayMessage(String message)
      Parameters:
      message - the message to display
    • getName

      public String getName()
      Returns:
      the bot name
    • 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
    • addAction

      public void addAction()
    • reset

      public void reset()
    • getObjectiveScore

      public int getObjectiveScore()
    • getAchievedObjectives

      public List<Objective> getAchievedObjectives()
    • getRedeemedObjectives

      public List<Objective> getRedeemedObjectives()
    • addObjective

      public void addObjective(Objective objective)
    • redeemObjective

      public void redeemObjective(Objective objective)
    • getPandaObjectiveScore

      public int getPandaObjectiveScore()
    • setObjectiveAchieved

      public void setObjectiveAchieved(Objective objective)
    • setStartingDeck

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

      public SingleBotStatistics getSingleBotStatistics()
    • toString

      public String toString()
      Overrides:
      toString in class Object