-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZScript.zsc
42 lines (31 loc) · 1.23 KB
/
ZScript.zsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version "2.4.0"
#include "ZScript/Util.zsc"
#include "ZScript/Subproc.zsc"
#include "ZScript/Parallel.zsc"
#include "Examples/ZScriptBase.zsc"
// Old engine version compatible branch.
class SubprocActor: Actor abstract {
/* Subroutines */
action State SUBP_Call( StateLabel label ) {
return SubproclibStatesStackKeeper.GetKeeper( invoker ).SubprocCall( label );
}
action State SUBP_Return( void ) {
return SubproclibStatesStackKeeper.GetKeeper( invoker ).SubprocReturn();
}
void SUBP_RemoveHandler( void ) {
SubproclibStatesStackKeeper.RemoveKeeper( self );
}
void SUBP_InitHandler( void ) {
SubproclibStatesStackKeeper.GetKeeper( self );
}
/* Parallelization */
action void PAR_Thread( StateLabel label, int steps = PARSTEPS_Infinite, EParallelExecDirectives execparams = PARSPR_SkipTNT1 ) {
SubproclibParallelExecKeeper.GetKeeper( invoker ).AddThread( label, steps, execparams );
}
action void PAR_Stop( StateLabel label = NULL ) {
SubproclibParallelExecKeeper.GetKeeper( invoker ).RemoveThread( label );
}
action void PAR_FrozeFlow( StateLabel label, bool freezethread ) {
SubproclibParallelExecKeeper.GetKeeper( invoker ).ThreadFrozeControl( label, freezethread );
}
} // of class SubprocActor: Actor abstract {}