|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.defcon.agent.impl.DefConAgentController<AGENT> cz.cuni.amis.pogamut.defcon.agent.impl.DefConAgentLogicController<AGENT>
AGENT
- Controlled agent's type.public class DefConAgentLogicController<AGENT extends DefConAgent>
Implements infrastructure for a logic of the bot and simplifies distinction between different stages of the game.
Field Summary | |
---|---|
protected BuildingsManager |
buildingsManager
|
protected IFlagChecker |
flagChecker
|
protected FleetsManager |
fleetsManager
|
protected GameInfo |
gameInfo
|
IWorldEventListener<GameRunningChanged> |
gameStartedListener
Annotation-based event listener registrator cannot handle inheritance, so we have to use this old styled method. |
protected DefConAgentLogic<AGENT> |
logicModule
|
protected DefConWorldView |
worldview
|
Fields inherited from class cz.cuni.amis.pogamut.defcon.agent.impl.DefConAgentController |
---|
agent |
Constructor Summary | |
---|---|
DefConAgentLogicController()
Assigns logicMethod, which gets executed in logic(). |
Method Summary | |
---|---|
void |
addGameLogicListener(ILogicUpdateListener updateListener)
Registers a listener from updates. |
void |
beforeFirstLogic()
|
void |
firstGameLogic()
Executed the first tick instead of gameLogic . |
void |
gameLogic()
Executed periodically while still in game. |
void |
gameLogicWorker()
Updates listeners, then calls gameLogic(); |
BuildingsManager |
getBuildingsManager()
|
IFlagChecker |
getFlagChecker()
Returns flag checker used for map analysis. |
FleetsManager |
getFleetsManager()
|
long |
getLogicInitializeTime()
|
long |
getLogicShutdownTime()
|
IMailBox |
getMailBox()
Returns the mailbox. |
Random |
getRandom()
Returns a random number generator. |
void |
initializeController(AGENT agent)
Registers anonymous listeners and creates logic module. |
void |
logic()
Gets executed periodically. |
void |
logicInitialize(LogicModule<AGENT> logicModule)
|
void |
logicShutdown()
|
void |
preGameLogic()
Executed instead of gameLogic while still in lobby. |
void |
unregisterUpdates(ILogicUpdateListener updateListener)
Unregisters a listener from updates. |
Methods inherited from class cz.cuni.amis.pogamut.defcon.agent.impl.DefConAgentController |
---|
act, botStopped, getAct, getGameInfo, getLog, getWorldView |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.amis.pogamut.defcon.agent.IDefConAgentController |
---|
botStopped |
Field Detail |
---|
protected DefConAgentLogic<AGENT extends DefConAgent> logicModule
protected DefConWorldView worldview
protected GameInfo gameInfo
protected FleetsManager fleetsManager
protected BuildingsManager buildingsManager
protected IFlagChecker flagChecker
public IWorldEventListener<GameRunningChanged> gameStartedListener
Constructor Detail |
---|
public DefConAgentLogicController()
Method Detail |
---|
public void initializeController(AGENT agent)
initializeController
in interface IDefConAgentController<AGENT extends DefConAgent>
initializeController
in class DefConAgentController<AGENT extends DefConAgent>
public long getLogicInitializeTime()
getLogicInitializeTime
in interface IAgentLogic<LogicModule<AGENT extends DefConAgent>>
public long getLogicShutdownTime()
getLogicShutdownTime
in interface IAgentLogic<LogicModule<AGENT extends DefConAgent>>
public void beforeFirstLogic()
beforeFirstLogic
in interface IAgentLogic<LogicModule<AGENT extends DefConAgent>>
public void logic()
logicMethod
field.
logic
in interface IAgentLogic<LogicModule<AGENT extends DefConAgent>>
public void preGameLogic()
gameLogic
while still in lobby.
This is what you could use to talk while the game is not running yet.
Defcon API is not entirely clear if this is OK, so if you run into any problems with it,
we would be glad to hear about them.
public void firstGameLogic()
gameLogic
.
public void gameLogic()
public final void gameLogicWorker()
public void logicInitialize(LogicModule<AGENT> logicModule)
logicInitialize
in interface IAgentLogic<LogicModule<AGENT extends DefConAgent>>
public void logicShutdown()
logicShutdown
in interface IAgentLogic<LogicModule<AGENT extends DefConAgent>>
public void addGameLogicListener(ILogicUpdateListener updateListener)
updateListener
- public void unregisterUpdates(ILogicUpdateListener updateListener)
updateListener
- public final Random getRandom()
public final IMailBox getMailBox()
public IFlagChecker getFlagChecker()
public final FleetsManager getFleetsManager()
public final BuildingsManager getBuildingsManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |