Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

Init No New Posts Codes & Snippets

Started by
moyack

0 Members and 1 Guest are viewing this topic.

Init
on: February 22, 2012, 06:26:04 PM
Category: Variables
Language: vJASS

Code: jass
  1. library Init /* v1.0.0.0
  2. ************************************************************************************
  3. *
  4. *       module Init
  5. *
  6. *               interface private static method init takes nothing returns nothing
  7. *                       -       Runs at map init
  8. *
  9. *************************************************************************************
  10. *
  11. *       module InitTimer
  12. *
  13. *               interface private static method init takes nothing returns nothing
  14. *                       -       Runs after a one-shot timer with a period of 0
  15. *
  16. ************************************************************************************/
  17.         module Init
  18.                 static if thistype.init.exists then
  19.                         private static method onInit takes nothing returns nothing
  20.                                 call init()
  21.                         endmethod
  22.                 endif
  23.         endmodule
  24.        
  25.         module InitTimer
  26.                 static if thistype.init.exists then
  27.                         private static method initex takes nothing returns nothing
  28.                                 call DestroyTimer(GetExpiredTimer())
  29.                                 call init()
  30.                         endmethod
  31.                         private static method onInit takes nothing returns nothing
  32.                                 call TimerStart(CreateTimer(), 0, false, function thistype.initex)
  33.                         endmethod
  34.                 endif
  35.         endmodule
  36. endlibrary
« Last Edit: December 19, 2017, 12:55:10 AM by moyack »



 

Started by s[ub]lime

Replies: 25
Views: 33506
Tutorial Zone

Started by City17

Replies: 0
Views: 318
Jassdoc

Started by City17

Replies: 0
Views: 369
Jassdoc
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...