[Home]History of Bob

Robo Home | Changes | Preferences | AllPages


Revision 16 . . June 14, 2005 21:00 EST by Kawigi
Revision 15 . . June 14, 2005 20:52 EST by Dosnlinux
  

Difference (from prior major revision) (no other diffs)

Changed: 95c95,97
Okay, I misread the API. I thought the setTurnXradians? meathods weren't called until execute was, instead of "executes immediatly" Is the only reason the execute meathod is there is so that you can continue saving data? What other things would you be doing after you die that you would need to execute()? --dosnlinux
Okay, I misread the API. I thought the setTurnXradians? meathods weren't called until execute was, instead of "executes immediatly" Is the only reason the execute meathod is there is so that you can continue saving data? What other things would you be doing after you die that you would need to execute()? --dosnlinux

Your original understanding sounds correct. execute() makes everything happen that you called a setXXX method for, and also does any movement of the rest of the battle field - bots, bullets, etc., advancing to the next turn. In all of those updates, you could die (which could also happen during any blocking call). If you die, a DeathException? is thrown, which immediately exits the function and every other function you're in (including run) until the method that called run to begin with, at which point your bot stops executing. You never are supposed to get a chance to call execute after you die, continue saving data or continue getting events. The main thing you have to understand is when you die, your run method abruptly stops. -- Kawigi

Robo Home | Changes | Preferences | AllPages
Search: