Login
Register
Menu
Home
Forum
JassDoc
Types
Functions
Variables
Help
Chat
Media
Search
Search posts
WC3 JASS.com
"The Jass Vault" plus vJASS and Zinc
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Warcraft III Resources
Warcraft III Spells and Systems
Codes & Snippets
Hibrid TimerUtils
Warcraft III:
Maps
Models
Skins
Icons
Spells / Systems
Tools
Tutorials
Snippets
JASS vJASS Spells and Systems
Tutorials
Chat @Discord
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
Hibrid TimerUtils
Codes & Snippets
Started by
Guest
Views
2815
Replies
0
Users
1
1
Pages:
1
Go Down
0 Members and 1 Guest are viewing this topic.
Rating
Average Score
- 5 / 5
«
Created: October 09, 2017, 12:02:55 AM by moyack
»
moyack
Site Owner
Administrator
Posts:
971
WC3 Models: 20
WC3 Tutorials: 17
WC3 Tools: 19
WC3 Maps: 12
WC3 Skins: 0
WC3 Icons: 1
WC3 Spells: 16
Reputation:
1153
Site Admin - I love fix things
Hibrid TimerUtils
on:
December 20, 2014, 06:49:41 PM
Category:
Execution, Variables
Language:
vJASS
Related Topics or Resources
MicroTable
by
moyack
[snippet] AllocLoop (AKA Alloc 2)
by
moyack
Description
This small library allows to attach data structs into timers in an easy way, following the structure proposed by Vexorian, just for compatibility.
Requirements:
- Microtable
- Alloc
Actual Code
Code: jass
library
TimerUtils
requires
Alloc, MicroTable
private
struct
data
extends
array
static
key
K
// used to connect the data struct with the variable
static
key
D
// used to link other data struct to the timer
timer
t
implement
Alloc
method
destroy
takes
nothing
returns
nothing
call
PauseTimer
(.t)
call
ClearData(.t,
thistype
.K)
call
.deallocate()
endmethod
static
method
create
takes
nothing
returns
thistype
local
thistype
this
=
thistype
.
allocate
()
if
this
.t ==
null
then
set
this
.t =
CreateTimer
()
endif
call
StoreData(
this
.t,
thistype
.K,
this
)
return
this
endmethod
endstruct
function
NewTimer
takes
nothing
returns
timer
return
data(data.
create
()).t
endfunction
function
ReleaseTimer
takes
timer
t
returns
nothing
call
data(GetData(t, data.K)).destroy()
endfunction
function
SetTimerData
takes
timer
t,
integer
d
returns
nothing
call
StoreData(t, data.D, d)
endfunction
function
GetTimerData
takes
timer
t
returns
integer
return
GetData(t, data.D)
endfunction
endlibrary
«
Last Edit: December 19, 2017, 08:00:38 PM by moyack
»
WC3 Modding Information Center
Print
Pages:
1
Go Up
« previous
next »
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Warcraft III Resources
Warcraft III Spells and Systems
Codes & Snippets
Hibrid TimerUtils
PortaMx-SEF 1.54
|
PortaMx © 2008-2015
,
PortaMx corp.
Search
Username
Password
Always stay logged in
Forgot your password?