29 lines
693 B
JavaScript
29 lines
693 B
JavaScript
import { ParticlesDensity } from "./ParticlesDensity";
|
|
export class ParticlesNumber {
|
|
constructor() {
|
|
this.density = new ParticlesDensity();
|
|
this.limit = 0;
|
|
this.value = 100;
|
|
}
|
|
get max() {
|
|
return this.limit;
|
|
}
|
|
set max(value) {
|
|
this.limit = value;
|
|
}
|
|
load(data) {
|
|
var _a;
|
|
if (!data) {
|
|
return;
|
|
}
|
|
this.density.load(data.density);
|
|
const limit = (_a = data.limit) !== null && _a !== void 0 ? _a : data.max;
|
|
if (limit !== undefined) {
|
|
this.limit = limit;
|
|
}
|
|
if (data.value !== undefined) {
|
|
this.value = data.value;
|
|
}
|
|
}
|
|
}
|