cz.cuni.amis.pogamut.ut2004.bot
Interface IUT2004BotController<BOT extends UT2004Bot>

Package class diagram package IUT2004BotController
All Known Subinterfaces:
IUT2004BotLogicController<BOT,LOGIC_MODULE>
All Known Implementing Classes:
UT2004BotController, UT2004BotLogicController, UT2004BotModuleController, UT2004BotMultiController

public interface IUT2004BotController<BOT extends UT2004Bot>


Method Summary
 void botFirstSpawn(GameInfo gameInfo, ConfigChange currentConfig, InitedMessage init, Self self)
          This method is called only once whenever first batch of information what the bot can see is received.
 void botInitialized(GameInfo gameInfo, ConfigChange currentConfig, InitedMessage init)
          This method is called whenever InitedMessage is received.
 void botKilled(BotKilled event)
          Called whenever the bot gets killed inside the game.
 void botShutdown()
          Called whenever the bot is shutdown (has finished) or killed (not in the game but as the instance).
 void finishControllerInitialization()
          Called after botFirstSpawn(GameInfo, ConfigChange, InitedMessage, Self) as a hook for Pogamut's core developers to finalize initialization of various modules.
 IAct getAct()
          Returns mean for sending commands through bot's GB2004 communication channel.
 BOT getBot()
          Returns underlying controlled UT2004Bot class that is managing life-cycle of the bot.
 Initialize getInitializeCommand()
          This method is called after handshake with GameBots2004 is over and the GameBots2004 is awaiting the INIT command (Initialize class).
 Logger getLog()
          Returns user log of the controller.
 PasswordReply getPassword()
          Returns password that should be used to access the GameBots2004 server.
 IVisionWorldView getWorldView()
          Returns world view of the controlled that providing access to all objects/events the bot has.
 void initializeController(BOT bot)
          Called during the construction of the UT2004Bot before the GameBots2004 greets the bot even before prepareBot(UT2004Bot) method.
 void prepareBot(BOT bot)
          Called during the construction of the UT2004Bot before the GameBots2004 greets the bot.
 

Method Detail

getLog

Logger getLog()
Returns user log of the controller.

Returns:

getBot

BOT getBot()
Returns underlying controlled UT2004Bot class that is managing life-cycle of the bot.

Returns:

getAct

IAct getAct()
Returns mean for sending commands through bot's GB2004 communication channel.

Returns:

getWorldView

IVisionWorldView getWorldView()
Returns world view of the controlled that providing access to all objects/events the bot has.

Returns:

initializeController

void initializeController(BOT bot)
Called during the construction of the UT2004Bot before the GameBots2004 greets the bot even before prepareBot(UT2004Bot) method.

NOTE: This is Pogamut's developers reserved method - do not override it and if you do, always use 'super' to call parent's initializeController.


prepareBot

void prepareBot(BOT bot)
Called during the construction of the UT2004Bot before the GameBots2004 greets the bot.


getPassword

PasswordReply getPassword()
Returns password that should be used to access the GameBots2004 server.

Called only if the bot is challenged by the password request.

Returns:

getInitializeCommand

Initialize getInitializeCommand()
This method is called after handshake with GameBots2004 is over and the GameBots2004 is awaiting the INIT command (Initialize class). Here you have to construct the Initialize message where you may specify many starting parameters of the bot including: This message is then saved to private field initalizeCommand and is accessible via getInitializeCommand() method if required to probe the starting parameters (even though they can be changed during the bot's lifetime!).


botInitialized

void botInitialized(GameInfo gameInfo,
                    ConfigChange currentConfig,
                    InitedMessage init)
This method is called whenever InitedMessage is received. Various agent modules are usable since this method is called.

Parameters:
gameInfo -
config -
init -
self -

botFirstSpawn

void botFirstSpawn(GameInfo gameInfo,
                   ConfigChange currentConfig,
                   InitedMessage init,
                   Self self)
This method is called only once whenever first batch of information what the bot can see is received. It is sort of "first-logic-method" where you may issue commands for the first time and handle everything else in bot's logic then. It eliminates the need to have 'boolean firstLogic' field inside your bot.

Note that this method has advantage over the botInitialized(GameInfo, ConfigChange, InitedMessage) that you already have Self object.

Parameters:
gameInfo -
config -
init -
self -

finishControllerInitialization

void finishControllerInitialization()
Called after botFirstSpawn(GameInfo, ConfigChange, InitedMessage, Self) as a hook for Pogamut's core developers to finalize initialization of various modules.

NOTE: This is Pogamut's developers reserved method - do not override it and if you do, always use 'super' to call parent's finishControllerInitialization.


botKilled

void botKilled(BotKilled event)
Called whenever the bot gets killed inside the game.

Parameters:
event -

botShutdown

void botShutdown()
Called whenever the bot is shutdown (has finished) or killed (not in the game but as the instance).

Use the method to save your work / data collected during the run of the agent.

Pogamut's guarantee that this method is called even if exception happens inside your previous code.



Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.