File | Line |
---|
cz/cuni/amis/pogamut/sposh/context/UT2004Behaviour.java | 337 |
cz/cuni/amis/pogamut/sposh/context/UT2004Context.java | 339 |
protected void initialize() {
initializeModules(bot);
initializePathFinding(bot);
initializeListeners(bot);
}
/**
* Initializes {@link UT2004Behaviour#listenerRegistrator} and calls {@link AnnotationListenerRegistrator#addListeners()} method
* to probe all declared methods for event-annotation presence.
* @param bot
*/
protected void initializeListeners(BOT bot) {
listenerRegistrator = new AnnotationListenerRegistrator(this, getWorldView(), bot.getLogger().getCategory("Listeners"));
listenerRegistrator.addListeners();
}
/**
* Initializes path-finding modules: {@link UT2004BotModuleControllerNew#pathPlanner} and {@link UT2004BotModuleControllerNew#pathExecutor}.
* If you need different path planner / path executor - override this method and initialize your own modules.
* @param bot
*/
protected void initializePathFinding(BOT bot) {
pathPlanner = new UT2004AStarPathPlanner(bot);
fwMap = new FloydWarshallMap(bot);
pathExecutor =
new UT2004PathExecutor<ILocated>(
bot,
new LoqueNavigator<ILocated>(bot,
bot.getLog())
);
getBackToNavGraph = new UT2004GetBackToNavGraph(bot, info, move);
runStraight = new UT2004RunStraight(bot, info, move);
navigation = new UT2004Navigation(bot, pathExecutor, fwMap, getBackToNavGraph, runStraight);
}
/**
* Initializes memory/command modules of the bot.
*
* @param bot
*/
protected void initializeModules(BOT bot) {
world = getWorldView();
act = getAct();
game = new Game(bot);
info = new AgentInfo(bot, game);
visibility = new Visibility(bot, info); |
File | Line |
---|
cz/cuni/amis/pogamut/sposh/context/UT2004Behaviour.java | 382 |
cz/cuni/amis/pogamut/sposh/context/UT2004Context.java | 385 |
ctf = new CTF(bot, info);
players = new Players(bot);
descriptors = new ItemDescriptors(bot);
senses = new Senses(bot, info, players);
weaponry = new Weaponry(bot, descriptors);
items = new Items(bot, info, game, weaponry, null);
config = new AgentConfig(bot);
raycasting = new Raycasting(bot);
body = new CompleteBotCommandsWrapper(bot, weaponry, null);
shoot = body.getImprovedShooting();
move = body.getLocomotion();
weaponPrefs = new WeaponPrefs(weaponry, bot);
stats = new AgentStats(bot);
navBuilder = new NavigationGraphBuilder(bot); |