// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.worldgen.loader.climate;

import com.hypixel.hytale.procedurallib.json.NoisePropertyJsonLoader;
import com.google.gson.JsonObject;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;
import javax.annotation.Nonnull;
import com.google.gson.JsonElement;
import java.nio.file.Path;
import com.hypixel.hytale.procedurallib.json.SeedString;
import com.hypixel.hytale.server.worldgen.climate.ClimateNoise;
import com.hypixel.hytale.procedurallib.json.JsonLoader;
import com.hypixel.hytale.procedurallib.json.SeedResource;

public class ClimateNoiseJsonLoader<K extends SeedResource> extends JsonLoader<K, ClimateNoise>
{
    public ClimateNoiseJsonLoader(final SeedString<K> seed, final Path dataFolder, final JsonElement json) {
        super(seed, dataFolder, json);
    }
    
    @Nonnull
    @Override
    public ClimateNoise load() {
        return new ClimateNoise(this.loadGrid(), this.loadContinentNoise(), this.loadTemperatureNoise(), this.loadIntensityNoise(), this.loadThresholds());
    }
    
    @Nonnull
    protected ClimateNoise.Grid loadGrid() {
        return new ClimateGridJsonLoader(this.seed, this.dataFolder, this.get("Grid")).load();
    }
    
    @Nonnull
    protected NoiseProperty loadContinentNoise() {
        return new NoisePropertyJsonLoader(this.seed, this.dataFolder, this.mustGetObject("Continent", null)).load();
    }
    
    @Nonnull
    protected NoiseProperty loadTemperatureNoise() {
        return new NoisePropertyJsonLoader(this.seed, this.dataFolder, this.mustGetObject("Temperature", null)).load();
    }
    
    @Nonnull
    protected NoiseProperty loadIntensityNoise() {
        return new NoisePropertyJsonLoader(this.seed, this.dataFolder, this.mustGetObject("Intensity", null)).load();
    }
    
    @Nonnull
    protected ClimateNoise.Thresholds loadThresholds() {
        return new ContinentThresholdsJsonLoader(this.seed, this.dataFolder, this.mustGetObject("Thresholds", null)).load();
    }
    
    public interface Constants
    {
        public static final String KEY_NOISE = "Noise";
        public static final String KEY_GRID = "Grid";
        public static final String KEY_THRESHOLDS = "Thresholds";
        public static final String KEY_CONTINENT = "Continent";
    }
}
