Package com.takenoko.engine
Class BotManager
java.lang.Object
com.takenoko.engine.BotManager
This class is used to manage one bot.
- name
- objective
- number of actions
- bamboos eaten counter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Botprivate final BotStateprivate final ConsoleUserInterfaceprivate static final Botprivate static final ConsoleUserInterfaceprivate static final Stringprivate final intprivate final Stringprivate final SingleBotStatisticsprivate final UUID -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for the classBotManager(Bot bot) Constructor for the class but this time specifying which bot algorithm must be usedBotManager(Bot bot, String name) BotManager(ConsoleUserInterface consoleUserInterface, String name, Bot bot, BotState botState, SingleBotStatistics botStatistics) Constructor for the class -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddObjective(Objective objective) private booleanprivate voidDisplay debug messagesvoiddisplayMessage(String message) intReturn the bot inventorygetName()protected intintintvoidAsk for the bot to choose an action based on his algorithm and then execute the returned action.voidredeemObjective(Objective objective) voidreset()voidsetObjectiveAchieved(Objective objective) voidsetStartingDeck(List<Objective> objectives) Set the starting decktoString()
-
Field Details
-
DEFAULT_CONSOLE_USER_INTERFACE
-
DEFAULT_NAME
- See Also:
-
DEFAULT_BOT
-
consoleUserInterface
-
botState
-
name
-
bot
-
defaultNumberOfActions
private final int defaultNumberOfActions -
singleBotStatistics
-
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 interfacename- the name of the botbot- the botbotState- the bot statebotStatistics- the extended statistics for this botManager
-
BotManager
public BotManager()Default constructor for the class -
BotManager
Constructor for the class but this time specifying which bot algorithm must be used- Parameters:
bot- the bot
-
BotManager
-
-
Method Details
-
getUniqueID
-
playBot
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 gamehistory- 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
- Parameters:
message- the message to display
-
getName
- Returns:
- the bot name
-
getEatenBambooCounter
public int getEatenBambooCounter()- Returns:
- the number of bamboo eaten by the bot
-
getInventory
Return the bot inventory- Returns:
- the bot inventory
-
addAction
public void addAction() -
reset
public void reset() -
getObjectiveScore
public int getObjectiveScore() -
getAchievedObjectives
-
getRedeemedObjectives
-
addObjective
-
redeemObjective
-
getPandaObjectiveScore
public int getPandaObjectiveScore() -
setObjectiveAchieved
-
setStartingDeck
Set the starting deck- Parameters:
objectives- list of objectives
-
getSingleBotStatistics
-
toString
-