-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEffect.ts
executable file
·29 lines (28 loc) · 905 Bytes
/
Effect.ts
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
import { EffectColor } from "../structs/effect-color";
import { Light } from "../structs/light";
/**
* Common structure for an effect
*/
export abstract class Effect {
/**
* Singleton reference to Date.now() – you don't/shouldn't update this, it is handled for you. All effects will have the same reference to Date.now() in any given frame.
*/
readonly now: number;
/**
* Returns the next color for a given light
* @param light light to compute a color for
*/
abstract getColor(light: Light): EffectColor | undefined;
/**
* Runs a render frame
*/
abstract render(): void | Promise<void>;
/**
* Whether the effect should be included in the render stack at this time
*/
abstract enabled: boolean;
/**
* Whether the effect should be permanently removed from the render stack
*/
abstract finished: boolean;
}