Why init instead of static

Jump to navigation Jump to search
Revision as of 18 September 2011 at 13:25.
This is the thread's initial revision.

Why init instead of static

Chase, I believe the reason to use the init method instead of a static block within this class is that the static block won't be called until this class is loaded by the JVM the first time it's used. By using an init method and calling it from a static block in your bot class, you ensure it's called when your bot is loaded, before the battle starts and not causing any skipped turns. Hopefully somebody can confirm/deny that.

    Voidious15:25, 18 September 2011