|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface BotContext
Context send to a bot by the game.
This interface permits the bot to interact with the game
by asking information using info(infoType) or
acting using nextTurn(action).
| Nested Class Summary | |
|---|---|
static interface |
BotContext.Action<R extends BotContext.ActionResponse>
marker interface of all actions allowed to a bot. |
static interface |
BotContext.ActionResponse
marker interface of all responses retruns by the game. |
static interface |
BotContext.Info
marker interface of all informations provided by the game. |
| Method Summary | ||
|---|---|---|
Set<? extends Class<? extends BotContext.Action>> |
actionTypes()
Actions interfaces provided by the game to the bot. |
|
int |
getVersion()
Version of the game. |
|
|
info(Class<I> infoType)
return an object provided by the game that implements interfaces specified by infoType. |
|
Set<? extends Class<? extends BotContext.Info>> |
infoTypes()
Informations interfaces provided by the game to the bot. |
|
|
nextTurn(A action)
Ask the game to execute an action by the current bot. |
|
| Method Detail |
|---|
int getVersion()
Set<? extends Class<? extends BotContext.Info>> infoTypes()
info(Class)
to obtain an object implementing the interface.
version 1 of the game required interfaces : GameInfo,
ArenaInfo and BombInfo.
info(Class)<I extends BotContext.Info> I info(Class<I> infoType)
I - type of the interface.infoType - class of the interface.
IllegalArgumentException - if infoType is not one of
interfaces returns by infoType().infoTypes()Set<? extends Class<? extends BotContext.Action>> actionTypes()
nextTurn(BotContext.Action)
<R extends BotContext.ActionResponse,A extends BotContext.Action<R>> R nextTurn(A action)
throws DeadBotException
A - type of the action.R - type of the response corresponding to the action.action - to performs, this action may be null if the bot just want
to wait until the next game turn.
DeadBotException - if the current bot is dead.
IllegalArgumentException - if the action is not a recognized
action of the game.actionTypes(),
GameInfo.isAlive(),
GameInfo.getTourTime()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||