2023-02-17 11:06:01 +01:00

31 lines
799 B
JavaScript

import { setRangeValue } from "../../Utils/NumberUtils";
export class AnimationOptions {
constructor() {
this.count = 0;
this.enable = false;
this.speed = 1;
this.decay = 0;
this.sync = false;
}
load(data) {
if (!data) {
return;
}
if (data.count !== undefined) {
this.count = setRangeValue(data.count);
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
if (data.speed !== undefined) {
this.speed = setRangeValue(data.speed);
}
if (data.decay !== undefined) {
this.decay = setRangeValue(data.decay);
}
if (data.sync !== undefined) {
this.sync = data.sync;
}
}
}