@rbxts/planck 0.2.5 → 0.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +40 -51
- package/{out → src}/DependencyGraph.luau +220 -180
- package/src/Phase.d.ts +23 -0
- package/{out → src}/Phase.luau +41 -41
- package/src/Pipeline.d.ts +26 -0
- package/{out → src}/Pipeline.luau +86 -86
- package/src/Scheduler.d.ts +385 -0
- package/{out → src}/Scheduler.luau +207 -44
- package/src/__tests__/InitializerSystems.test.luau +660 -0
- package/src/__tests__/Scheduler.test.luau +313 -0
- package/src/__tests__/conditions.test.luau +147 -0
- package/src/__tests__/hooks.test.luau +54 -0
- package/src/__tests__/systems.test.luau +192 -0
- package/src/conditions.d.ts +69 -0
- package/{out → src}/conditions.luau +189 -151
- package/{out → src}/hooks.luau +163 -145
- package/src/index.d.ts +12 -0
- package/src/init.luau +207 -0
- package/src/utils.d.ts +10 -0
- package/{out → src}/utils.luau +197 -161
- package/out/Phase.d.ts +0 -8
- package/out/Pipeline.d.ts +0 -11
- package/out/Scheduler.d.ts +0 -31
- package/out/conditions.d.ts +0 -14
- package/out/hooks.d.ts +0 -4
- package/out/index.d.ts +0 -18
- package/out/init.luau +0 -143
- package/out/types.d.ts +0 -113
- package/out/utils.d.ts +0 -4
package/{out → src}/utils.luau
RENAMED
|
@@ -1,161 +1,197 @@
|
|
|
1
|
-
type Phase = any
|
|
2
|
-
type Pipeline = any
|
|
3
|
-
|
|
4
|
-
type SystemFn<U...> = (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
local
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[any]:
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
1
|
+
type Phase = any
|
|
2
|
+
type Pipeline = any
|
|
3
|
+
|
|
4
|
+
type SystemFn<U...> = (U...) -> ()
|
|
5
|
+
type SystemInitializerFn<U...> = (U...) -> SystemFn<U...>
|
|
6
|
+
|
|
7
|
+
type SystemTable<U...> = {
|
|
8
|
+
system: SystemFn<U...> | SystemInitializerFn<U...>,
|
|
9
|
+
phase: Phase?,
|
|
10
|
+
[any]: any,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type System<U...> = SystemFn<U...> | SystemInitializerFn<U...> | SystemTable<U...>
|
|
14
|
+
|
|
15
|
+
local function getSystem<U...>(system: any): SystemTable<U...>?
|
|
16
|
+
if type(system) == "function" then
|
|
17
|
+
return system
|
|
18
|
+
elseif type(system) == "table" and system.system then
|
|
19
|
+
return system.system
|
|
20
|
+
else
|
|
21
|
+
return nil
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
local function getSystemName(system: any): string
|
|
26
|
+
if type(system) == "table" and system.name then
|
|
27
|
+
return system.name
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
local fn = type(system) == "table" and system.system or system
|
|
31
|
+
|
|
32
|
+
local name = debug.info(fn, "n")
|
|
33
|
+
if not name or string.len(name) == 0 then
|
|
34
|
+
local source, line = debug.info(fn, "sl")
|
|
35
|
+
name = `{source}:{line}`
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
return name
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
local function isPhase(phase: any): Phase?
|
|
42
|
+
if type(phase) == "table" and phase._type == "phase" then
|
|
43
|
+
return phase
|
|
44
|
+
else
|
|
45
|
+
return nil
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
local function isPipeline(pipeline: any): Pipeline?
|
|
50
|
+
if type(pipeline) == "table" and pipeline._type == "pipeline" then
|
|
51
|
+
return pipeline
|
|
52
|
+
else
|
|
53
|
+
return nil
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
local function getEventIdentifier(instance, event)
|
|
58
|
+
return `{instance}{event and `@{event}` or ""}`
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
local EVENT_CONNECT_METHODS = { "Connect", "On", "on", "connect" }
|
|
62
|
+
|
|
63
|
+
export type ConnectionLike = RBXScriptConnection | {
|
|
64
|
+
disconnect: (self: ConnectionLike, ...any) -> any,
|
|
65
|
+
[any]: any,
|
|
66
|
+
} | {
|
|
67
|
+
Disconnect: (self: ConnectionLike, ...any) -> any,
|
|
68
|
+
[any]: any,
|
|
69
|
+
} | {
|
|
70
|
+
destroy: (self: ConnectionLike, ...any) -> any,
|
|
71
|
+
[any]: any,
|
|
72
|
+
} | {
|
|
73
|
+
Destroy: (self: ConnectionLike, ...any) -> any,
|
|
74
|
+
[any]: any,
|
|
75
|
+
} | (...any) -> any
|
|
76
|
+
|
|
77
|
+
local EVENT_DISCONNECT_METHODS =
|
|
78
|
+
{ "disconnect", "Disconnect", "destroy", "Destroy" }
|
|
79
|
+
|
|
80
|
+
local function disconnectEvent(connection: ConnectionLike)
|
|
81
|
+
if type(connection) == "function" then
|
|
82
|
+
connection()
|
|
83
|
+
return
|
|
84
|
+
elseif typeof(connection) == "RBXScriptConnection" then
|
|
85
|
+
connection:Disconnect()
|
|
86
|
+
return
|
|
87
|
+
elseif type(connection) == "table" then
|
|
88
|
+
for _, method in EVENT_DISCONNECT_METHODS do
|
|
89
|
+
if
|
|
90
|
+
connection[method]
|
|
91
|
+
and type(connection[method]) == "function"
|
|
92
|
+
then
|
|
93
|
+
connection[method](connection)
|
|
94
|
+
return
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
export type Callback<U...> = (U...) -> ...any
|
|
101
|
+
export type ConnectFn<T, U...> = (callback: (U...) -> ...any) -> T
|
|
102
|
+
export type GenericTable = { [any]: any }
|
|
103
|
+
|
|
104
|
+
export type SignalLike<U...> =
|
|
105
|
+
{
|
|
106
|
+
connect: (self: SignalLike<U...>, Callback<U...>, ...any?) -> any,
|
|
107
|
+
[any]: any,
|
|
108
|
+
}
|
|
109
|
+
| {
|
|
110
|
+
Connect: (self: SignalLike<U...>, Callback<U...>, ...any?) -> any,
|
|
111
|
+
[any]: any,
|
|
112
|
+
}
|
|
113
|
+
| {
|
|
114
|
+
on: (self: SignalLike<U...>, Callback<U...>, ...any?) -> any,
|
|
115
|
+
[any]: any,
|
|
116
|
+
}
|
|
117
|
+
| {
|
|
118
|
+
On: (self: SignalLike<U...>, Callback<U...>, ...any?) -> any,
|
|
119
|
+
[any]: any,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
type GetConnectFn<U...> =
|
|
123
|
+
-- RBXScriptSignal & nil
|
|
124
|
+
((RBXScriptSignal<U...>) -> ConnectFn<RBXScriptConnection, U...>)
|
|
125
|
+
-- Instance & RBXScriptSignal
|
|
126
|
+
-- Instance & string
|
|
127
|
+
& ((
|
|
128
|
+
Instance,
|
|
129
|
+
RBXScriptSignal<U...> | string
|
|
130
|
+
) -> ConnectFn<RBXScriptConnection, U...>)
|
|
131
|
+
-- SignalLike & nil
|
|
132
|
+
& ((SignalLike<U...>) -> ConnectFn<any, U...>)
|
|
133
|
+
-- table & string
|
|
134
|
+
& ((GenericTable, string) -> ConnectFn<any, U...>)
|
|
135
|
+
-- table & connectable method
|
|
136
|
+
& (<T>(
|
|
137
|
+
GenericTable,
|
|
138
|
+
(GenericTable, Callback<U...>, ...any) -> T
|
|
139
|
+
) -> ConnectFn<T, U...>)
|
|
140
|
+
-- connectable function
|
|
141
|
+
& (<T>((Callback<U...>, ...any) -> T) -> ConnectFn<T, U...>)
|
|
142
|
+
|
|
143
|
+
-- This function is inspired by useEvent in Matter, a library by evaera (https://github.com/evaera)
|
|
144
|
+
-- License: Copyright (c) 2021 Eryn L. K., MIT License
|
|
145
|
+
-- Source: https://github.com/matter-ecs/matter/blob/main/lib/hooks/useEvent.luau
|
|
146
|
+
local function getConnectFunction(instance, event)
|
|
147
|
+
local eventInstance = instance
|
|
148
|
+
|
|
149
|
+
if typeof(event) == "RBXScriptSignal" or type(event) == "table" then
|
|
150
|
+
eventInstance = event
|
|
151
|
+
elseif type(event) == "string" then
|
|
152
|
+
eventInstance = (instance :: any)[event]
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if type(eventInstance) == "function" then
|
|
156
|
+
return eventInstance
|
|
157
|
+
elseif typeof(eventInstance) == "RBXScriptSignal" then
|
|
158
|
+
return function(callback)
|
|
159
|
+
return eventInstance:Connect(callback)
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if type(eventInstance) == "table" then
|
|
164
|
+
if type(event) == "function" then
|
|
165
|
+
return function(callback)
|
|
166
|
+
return event(eventInstance, callback)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
for _, method in EVENT_CONNECT_METHODS do
|
|
171
|
+
if type(eventInstance[method]) ~= "function" then
|
|
172
|
+
continue
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
return function(callback)
|
|
176
|
+
return eventInstance[method](eventInstance, callback)
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
return nil
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
local function isValidEvent(instance, event)
|
|
185
|
+
return getConnectFunction(instance, event) ~= nil
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
getSystem = getSystem,
|
|
190
|
+
getSystemName = getSystemName,
|
|
191
|
+
isPhase = isPhase,
|
|
192
|
+
isPipeline = isPipeline,
|
|
193
|
+
getEventIdentifier = getEventIdentifier,
|
|
194
|
+
isValidEvent = isValidEvent,
|
|
195
|
+
getConnectFunction = getConnectFunction :: GetConnectFn<...any>,
|
|
196
|
+
disconnectEvent = disconnectEvent,
|
|
197
|
+
}
|
package/out/Phase.d.ts
DELETED
package/out/Pipeline.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Phase from "./Phase";
|
|
2
|
-
|
|
3
|
-
declare class Pipeline {
|
|
4
|
-
constructor(debugName?: string)
|
|
5
|
-
insert(phase: Phase) : Pipeline
|
|
6
|
-
insertAfter(phase: Phase, after: Phase): Pipeline
|
|
7
|
-
insertBefore(phase: Phase, before: Phase): Pipeline
|
|
8
|
-
static readonly Startup: Pipeline
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export = Pipeline;
|
package/out/Scheduler.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import Phase from "./Phase";
|
|
2
|
-
import Pipeline from "./Pipeline";
|
|
3
|
-
import { Hooks, EventInstance, EventLike, System, Plugin, HookFunctionMap, HookFunctionArgs } from "./types";
|
|
4
|
-
|
|
5
|
-
declare class Scheduler<T extends unknown[]> {
|
|
6
|
-
/** @hidden */
|
|
7
|
-
_orderedPhases: Phase[]
|
|
8
|
-
Hooks: Hooks["Hooks"]
|
|
9
|
-
cleanup(): void
|
|
10
|
-
addRunCondition(dependent: System<T>, fn: (...args: T) => boolean): Scheduler<T>
|
|
11
|
-
replaceSystem(oldSystem: System<T>, newSystem: System<T>): Scheduler<T>
|
|
12
|
-
removeSystem(system: System<T>): Scheduler<T>
|
|
13
|
-
editSystem(system: System<T>, phase: Phase): Scheduler<T>
|
|
14
|
-
addSystem(system: System<T>, phase?: Phase): Scheduler<T>
|
|
15
|
-
addSystems(systems: System<T>[], phase?: Phase): Scheduler<T>
|
|
16
|
-
insertBefore(dependent: Phase, before: Phase): Scheduler<T>
|
|
17
|
-
insertBefore(dependent: Pipeline, before: Phase): Scheduler<T>
|
|
18
|
-
insertAfter(phase: Phase, after: Phase | Pipeline): Scheduler<T>
|
|
19
|
-
insertAfter(pipeline: Pipeline, after: Phase | Pipeline): Scheduler<T>
|
|
20
|
-
insert(dependent: Phase | Pipeline, instance: EventInstance, event?: string): Scheduler<T>
|
|
21
|
-
insert(dependent: Phase | Pipeline): Scheduler<T>
|
|
22
|
-
runAll(): Scheduler<T>
|
|
23
|
-
run(dependent: System<T> | Phase | Pipeline): Scheduler<T>
|
|
24
|
-
getDeltaTime(): number
|
|
25
|
-
addPlugin(plugin: Plugin): Scheduler<T>
|
|
26
|
-
/** @hidden */
|
|
27
|
-
_addHook<K extends keyof HookFunctionMap>(hook: K, fn: (info: HookFunctionArgs<K, T>) => void): void
|
|
28
|
-
constructor(...args: T)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export = Scheduler;
|
package/out/conditions.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { EventInstance, EventLike } from "./types";
|
|
2
|
-
|
|
3
|
-
type Condition = () => boolean;
|
|
4
|
-
|
|
5
|
-
declare const timePassed: (time: number) => Condition;
|
|
6
|
-
|
|
7
|
-
declare const exported: {
|
|
8
|
-
timePassed: (time: number) => Condition;
|
|
9
|
-
runOnce: () => Condition;
|
|
10
|
-
onEvent: <T extends unknown[]>(instance: EventInstance<T>, event?: string) => LuaTuple<[Condition, () => IterableFunction<LuaTuple<[number, ...T]>>, () => void]>;
|
|
11
|
-
isNot: (condition: Condition) => Condition;
|
|
12
|
-
cleanupCondition: (condition: Condition) => void
|
|
13
|
-
}
|
|
14
|
-
export = exported
|
package/out/hooks.d.ts
DELETED
package/out/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import phase from "./Phase";
|
|
2
|
-
import pipeline from "./Pipeline";
|
|
3
|
-
import schedular from "./Scheduler";
|
|
4
|
-
import condition from "./conditions"
|
|
5
|
-
|
|
6
|
-
interface Planck {
|
|
7
|
-
Phase: typeof phase;
|
|
8
|
-
Pipeline: typeof pipeline;
|
|
9
|
-
Scheduler: typeof schedular;
|
|
10
|
-
|
|
11
|
-
isNot: typeof condition.isNot;
|
|
12
|
-
timePassed: typeof condition.timePassed;
|
|
13
|
-
runOnce: typeof condition.runOnce;
|
|
14
|
-
onEvent: typeof condition.onEvent;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare const planck: Planck;
|
|
18
|
-
export = planck;
|
package/out/init.luau
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
local Phase = require(script:FindFirstChild("Phase")) :: any
|
|
2
|
-
local Pipeline = require(script:FindFirstChild("Pipeline")) :: any
|
|
3
|
-
local Scheduler = require(script:FindFirstChild("Scheduler")) :: any
|
|
4
|
-
|
|
5
|
-
local conditions = require(script:FindFirstChild("conditions"))
|
|
6
|
-
local utils = require(script:FindFirstChild("utils"))
|
|
7
|
-
|
|
8
|
-
type EventLike = utils.EventLike
|
|
9
|
-
type EventInstance = utils.EventInstance
|
|
10
|
-
|
|
11
|
-
export type SystemFn<U...> = ((U...) -> any) | ((U...) -> ())
|
|
12
|
-
|
|
13
|
-
export type SystemTable<U...> = {
|
|
14
|
-
system: SystemFn<U...>,
|
|
15
|
-
phase: Phase?,
|
|
16
|
-
name: string?,
|
|
17
|
-
runConditions: { (U...) -> boolean }?,
|
|
18
|
-
[any]: any,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type System<U...> = SystemFn<U...> | SystemTable<U...>
|
|
22
|
-
|
|
23
|
-
export type Phase = {
|
|
24
|
-
PreStartup: Phase,
|
|
25
|
-
Startup: Phase,
|
|
26
|
-
PostStartup: Phase,
|
|
27
|
-
|
|
28
|
-
new: (debugName: string?) -> Phase,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type Pipeline = {
|
|
32
|
-
Startup: Pipeline,
|
|
33
|
-
|
|
34
|
-
insert: (self: Pipeline, phase: Phase) -> Pipeline,
|
|
35
|
-
insertAfter: (self: Pipeline, phase: Phase, after: Phase) -> Pipeline,
|
|
36
|
-
new: (debugName: string?) -> Pipeline,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
type Plugin<U...> = {
|
|
40
|
-
build: (self: Plugin<U...>, scheduler: Scheduler<U...>) -> (),
|
|
41
|
-
cleanup: ((self: Plugin<U...>) -> ())?,
|
|
42
|
-
[any]: any,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type Scheduler<U...> = {
|
|
46
|
-
addPlugin: (self: Scheduler<U...>, plugin: Plugin<U...>) -> Scheduler<U...>,
|
|
47
|
-
|
|
48
|
-
addSystem: (
|
|
49
|
-
self: Scheduler<U...>,
|
|
50
|
-
system: System<U...>,
|
|
51
|
-
phase: Phase?
|
|
52
|
-
) -> Scheduler<U...>,
|
|
53
|
-
|
|
54
|
-
addSystems: (
|
|
55
|
-
self: Scheduler<U...>,
|
|
56
|
-
systems: { System<U...> },
|
|
57
|
-
phase: Phase?
|
|
58
|
-
) -> Scheduler<U...>,
|
|
59
|
-
|
|
60
|
-
editSystem: (
|
|
61
|
-
self: Scheduler<U...>,
|
|
62
|
-
system: System<U...>,
|
|
63
|
-
new: Phase
|
|
64
|
-
) -> Scheduler<U...>,
|
|
65
|
-
|
|
66
|
-
replaceSystem: (
|
|
67
|
-
self: Scheduler<U...>,
|
|
68
|
-
system: System<U...>,
|
|
69
|
-
new: System<U...>
|
|
70
|
-
) -> Scheduler<U...>,
|
|
71
|
-
|
|
72
|
-
removeSystem: (
|
|
73
|
-
self: Scheduler<U...>,
|
|
74
|
-
system: System<U...>
|
|
75
|
-
) -> Scheduler<U...>,
|
|
76
|
-
|
|
77
|
-
addRunCondition: ((
|
|
78
|
-
self: Scheduler<U...>,
|
|
79
|
-
system: System<U...>,
|
|
80
|
-
fn: (U...) -> boolean,
|
|
81
|
-
...any
|
|
82
|
-
) -> Scheduler<U...>) & ((
|
|
83
|
-
self: Scheduler<U...>,
|
|
84
|
-
phase: Phase,
|
|
85
|
-
fn: (U...) -> boolean,
|
|
86
|
-
...any
|
|
87
|
-
) -> Scheduler<U...>) & ((
|
|
88
|
-
self: Scheduler<U...>,
|
|
89
|
-
pipeline: Pipeline,
|
|
90
|
-
fn: (U...) -> boolean,
|
|
91
|
-
...any
|
|
92
|
-
) -> Scheduler<U...>),
|
|
93
|
-
|
|
94
|
-
run: ((self: Scheduler<U...>, system: System<U...>) -> Scheduler<U...>)
|
|
95
|
-
& ((self: Scheduler<U...>, phase: Phase) -> Scheduler<U...>)
|
|
96
|
-
& ((self: Scheduler<U...>, pipeline: Pipeline) -> Scheduler<U...>),
|
|
97
|
-
|
|
98
|
-
runAll: (self: Scheduler<U...>) -> Scheduler<U...>,
|
|
99
|
-
|
|
100
|
-
getDeltaTime: (self: Scheduler<U...>) -> number,
|
|
101
|
-
|
|
102
|
-
insert: ((self: Scheduler<U...>, phase: Phase) -> Scheduler<U...>) & ((
|
|
103
|
-
self: Scheduler<U...>,
|
|
104
|
-
pipeline: Pipeline
|
|
105
|
-
) -> Scheduler<U...>) & ((
|
|
106
|
-
self: Scheduler<U...>,
|
|
107
|
-
phase: Phase,
|
|
108
|
-
instance: EventInstance | EventLike,
|
|
109
|
-
event: string | EventLike
|
|
110
|
-
) -> Scheduler<U...>) & ((
|
|
111
|
-
self: Scheduler<U...>,
|
|
112
|
-
Pipeline: Pipeline,
|
|
113
|
-
instance: EventInstance | EventLike,
|
|
114
|
-
event: string | EventLike
|
|
115
|
-
) -> Scheduler<U...>),
|
|
116
|
-
|
|
117
|
-
insertAfter: ((
|
|
118
|
-
self: Scheduler<U...>,
|
|
119
|
-
phase: Phase,
|
|
120
|
-
after: Phase | Pipeline
|
|
121
|
-
) -> Scheduler<U...>) & ((
|
|
122
|
-
self: Scheduler<U...>,
|
|
123
|
-
pipeline: Pipeline,
|
|
124
|
-
after: Phase | Pipeline
|
|
125
|
-
) -> Scheduler<U...>),
|
|
126
|
-
|
|
127
|
-
cleanup: (self: Scheduler<U...>) -> (),
|
|
128
|
-
|
|
129
|
-
new: (U...) -> Scheduler<U...>,
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return {
|
|
133
|
-
Phase = Phase :: Phase,
|
|
134
|
-
Pipeline = Pipeline :: Pipeline,
|
|
135
|
-
Scheduler = Scheduler :: {
|
|
136
|
-
new: <U...>(U...) -> Scheduler<U...>,
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
isNot = conditions.isNot,
|
|
140
|
-
runOnce = conditions.runOnce,
|
|
141
|
-
timePassed = conditions.timePassed,
|
|
142
|
-
onEvent = conditions.onEvent,
|
|
143
|
-
}
|