import { customWorld } from "./util";
export class FogHandler {
    constructor(player, biome) {
        this.player = player;
        this.biome = biome;
        this.processFog();
    }
    processFog() {
        const biomeName = customWorld.getBiomeName(this.biome);
        const lastKnownFog = this.player.getDynamicProperty('lastKnownFog');
        if (biomeName !== undefined) {
            const fogId = `pu_biomes:fog_${biomeName}`;
            if (lastKnownFog === fogId) {
                return;
            }
            this.player.runCommand(`fog @s push ${fogId} ${fogId}`);
            if (lastKnownFog)
                this.player.runCommand(`fog @s pop ${lastKnownFog}`);
            this.player.setDynamicProperty('lastKnownFog', fogId);
        }
        else {
            if (lastKnownFog) {
                this.player.runCommand(`fog @s pop ${lastKnownFog}`);
                this.player.setDynamicProperty('lastKnownFog', undefined);
            }
        }
    }
    setFog(fogId) {
    }
}
