2024-12-08 16:53:56 +01:00
|
|
|
import {SnowEffect} from "./SnowEffect.js";
|
2024-12-14 12:09:49 +01:00
|
|
|
import {RainEffect} from "./RainEffect.js";
|
|
|
|
import {ThunderstormEffect} from "./ThunderstormEffect.js";
|
2024-12-08 16:53:56 +01:00
|
|
|
|
|
|
|
export class FullscreenEffectFactory
|
|
|
|
{
|
|
|
|
static EFFECTS = {
|
|
|
|
[SnowEffect.NAME]: SnowEffect,
|
2024-12-14 12:09:49 +01:00
|
|
|
[RainEffect.NAME]: RainEffect,
|
|
|
|
[ThunderstormEffect.NAME]: ThunderstormEffect,
|
2024-12-08 16:53:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
getEffect(name)
|
|
|
|
{
|
|
|
|
return new FullscreenEffectFactory.EFFECTS[name]();
|
|
|
|
}
|
|
|
|
|
|
|
|
static getNames()
|
|
|
|
{
|
|
|
|
const names = [];
|
|
|
|
|
|
|
|
for (const name in FullscreenEffectFactory.EFFECTS) {
|
|
|
|
names.push(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(names);
|
|
|
|
|
|
|
|
return names;
|
|
|
|
}
|
|
|
|
}
|