Difference between revisions of "User:D414"
Jump to navigation
Jump to search
(Created page with "= Personal Gotchas = == Event Priority == The documentation for event priorities is unclear. [https://robocode.sourceforge.io/docs/robocode/robocode/AdvancedRobot.html#setEven...") |
|||
Line 2: | Line 2: | ||
== Event Priority == | == Event Priority == | ||
The documentation for event priorities is unclear. [https://robocode.sourceforge.io/docs/robocode/robocode/AdvancedRobot.html#setEventPriority-java.lang.String-int- setEventPriority] says lower values are higher priority while [https://robocode.sourceforge.io/docs/robocode/robocode/AdvancedRobot.html#getEventPriority-java.lang.String- getEventPriority] says higher values are higher priority. Testing confirms the later is correct. Also note that the priority of RoundEndedEvent is 110, not 100 as documented. | The documentation for event priorities is unclear. [https://robocode.sourceforge.io/docs/robocode/robocode/AdvancedRobot.html#setEventPriority-java.lang.String-int- setEventPriority] says lower values are higher priority while [https://robocode.sourceforge.io/docs/robocode/robocode/AdvancedRobot.html#getEventPriority-java.lang.String- getEventPriority] says higher values are higher priority. Testing confirms the later is correct. Also note that the priority of RoundEndedEvent is 110, not 100 as documented. | ||
+ | == Execute Method == | ||
+ | The documentation for the [https://robocode.sourceforge.io/docs/robocode/robocode/AdvancedRobot.html#execute-- execute] method says that it '''must''' be called otherwise set* methods will never be performed. This doesn't seem to be strictly true as a robot that uses set methods to spin its radar, gun and body in the [https://robocode.sourceforge.io/docs/robocode/robocode/Robot.html#run-- run] method will spin even without calling [https://robocode.sourceforge.io/docs/robocode/robocode/AdvancedRobot.html#execute-- execute]. |
Revision as of 23:44, 5 February 2024
Personal Gotchas
Event Priority
The documentation for event priorities is unclear. setEventPriority says lower values are higher priority while getEventPriority says higher values are higher priority. Testing confirms the later is correct. Also note that the priority of RoundEndedEvent is 110, not 100 as documented.
Execute Method
The documentation for the execute method says that it must be called otherwise set* methods will never be performed. This doesn't seem to be strictly true as a robot that uses set methods to spin its radar, gun and body in the run method will spin even without calling execute.