Prometheus
Everything is mutable; nothing is sacred
- Reaction score
- 589
I know the title sounds retarded, but this is basically putting a time limit on a looping timer. There's a little nagging voice in the back of my head that says "This is missing something" or "This could be done better." Comments?
<3
I know there's CSSafety/CSData or structs and structs are better but I don't know how to use structs. CSSafety/CSData would require more coding then needed then if there was structs. Suggestions?
<3
JASS:
library Timed
globals
private timer array T
private timer array D
private gamecache GC
endglobals
private function DestTime takes nothing returns nothing
call DestroyTimer(D[GetStoredInteger(GC, R2S(TimerGetTimeout(GetExpiredTimer())), "Timed_Timer")])
endfunction
public function Timer takes timer t, real r, integer i returns nothing
call FlushGameCache(InitGameCache("Timed.x"))
call InitGameCache("Timed.x")
set T<i> = CreateTimer()
set D<i> = t
call TimerStart(T<i>, r, false, function DestTime)
call StoreInteger(GC, R2S(TimerGetTimeout(T<i>)), "Timed_Timer", i)
endfunction
endlibrary
</i></i></i></i>
I know there's CSSafety/CSData or structs and structs are better but I don't know how to use structs. CSSafety/CSData would require more coding then needed then if there was structs. Suggestions?