-
Notifications
You must be signed in to change notification settings - Fork 3
Libraries
Franco Montenegro edited this page Apr 17, 2016
·
4 revisions
Libraries work the same as vJASS. The only thing to remember though, is that the requires
defines the execution of the initialization code.
So for example
library foo requires bar
function onInit takes nothing returns nothing
endfunction
endlibrary
library bar
function onInit takes nothing returns nothing
endfunction
endlibrary
The onInit
of bar
is going to be executed first, and then foo
.
By default, all members of a library are private. The same goes for global variables.
If there is a function called onInit
it will automatically get called at map initialization.
library foo // no need for 'initializer onInit'
function onInit
call BJDebugMsg("Nice!")
endfunction
endlibrary
library foo
public function bar ...
endfunction
public struct baz
public static method someMethod ...
endmethod
endstruct
endlibrary
call foo.bar()
call foo.baz.someMethod()
You have to use "." (dot) in vrJASS instead of "_" (underscore).