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 Bot
private final BotState
private final ConsoleUserInterface
private static final Bot
private static final ConsoleUserInterface
private static final String
private final int
private final String
private final SingleBotStatistics
private 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 TypeMethodDescriptionvoid
void
addObjective
(Objective objective) private boolean
private void
Display debug messagesvoid
displayMessage
(String message) int
Return the bot inventorygetName()
protected int
int
int
void
Ask for the bot to choose an action based on his algorithm and then execute the returned action.void
redeemObjective
(Objective objective) void
reset()
void
setObjectiveAchieved
(Objective objective) void
setStartingDeck
(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
-