[Pogamut-list] Threads
fireball787b
pogamut-forum at diana.ms.mff.cuni.cz
Wed Feb 20 15:34:07 CET 2013
Re: Threads
Author: fireball787b
i think i got it!
i've created a list for the instances:
Private static List botInstances;
and i've initialized it in the main menu:
public.. main...
{
botInstances = new UT2004BotRunner(SmartBot.class, "SmartBot").setMain(false).StartAgents(4);
new UT2004BotRunner(SmartBot.class, "MasterBot").setMain(true).StartAgents();
//question: should i create another list only for the masterBot instance?
}
After all this, in the MasterBot logic part i would do something like this:
for(i = 0:num_bots)
((SmartBot)botInstances.get(i).getController()).getBot().pause();
*operations*
for(i = 0:num_bots)
((SmartBot)botInstances.get(i).getController()).getBot().resume();
is this what you meant before? :)
--
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=6&comments_reply_threadId=6&comments_parentId=1134&post_reply=1#form>
More information about the Pogamut-list
mailing list