/
MoveTrail.ts
37 lines (30 loc) · 968 Bytes
/
MoveTrail.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
30
31
32
33
34
35
36
37
import type { IMoveTrail } from "../../../Interfaces/Particles/Move/IMoveTrail";
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
import { OptionsColor } from "../../OptionsColor";
import type { RecursivePartial } from "../../../../Types/RecursivePartial";
/**
* @category Options
*/
export class MoveTrail implements IMoveTrail, IOptionLoader<IMoveTrail> {
enable;
fillColor;
length;
constructor() {
this.enable = false;
this.length = 10;
this.fillColor = new OptionsColor();
this.fillColor.value = "#000000";
}
load(data?: RecursivePartial<IMoveTrail>): void {
if (!data) {
return;
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
this.fillColor = OptionsColor.create(this.fillColor, data.fillColor);
if (data.length !== undefined) {
this.length = data.length;
}
}
}