package ca.recrown.islandsurvivalcraft.utilities.biomes;

import org.bukkit.block.Biome;

import ca.recrown.islandsurvivalcraft.utilities.weighting.Weightable;

public class LandBiomeInfo implements Weightable {
    private final Biome biome;
    private final float weight;
    private final Biome hillBiome;
    private final Biome transitionBiome;
    private final Biome preferredShore;
    
    /**
     * Creates a land biome information object.
     * @param biome the main biome this object represents.
     * @param transitionBiome the transition biome to go with this biome. May be null.
     * @param hill the hill biome that goes with this biome. May be null.
     * @param shore the preferred shore that goes with this biome. May be null.
     * @param weight the weight, relative to the others, chance this biome spawns.
     */
    public LandBiomeInfo(Biome biome, Biome transitionBiome, Biome hill, Biome shore, float weight) {
        if (biome == null) throw new IllegalArgumentException("Argument biome may never be null.");
        this.weight = weight;
        this.biome = biome;
        this.hillBiome = hill;
        this.preferredShore = shore;
        this.transitionBiome = transitionBiome;
    }

    public LandBiomeInfo(Biome biome, float weight) {
        this(biome, null, null, Biome.BEACH, weight);
    }

    /**
     * @return the weight
     */
    public float getWeight() {
        return weight;
    }

    /**
     * @return the biome
     */
    public Biome getBiome() {
        return biome;
    }

    /**
     * @return the hill biome. May be null.
     */
    public Biome getHillBiome() {
        return hillBiome;
    }

    /**
     * @return the shore biome.
     */
    public Biome getPreferredShore() {
        return preferredShore;
    }

    /**
     * @return the transition biome if it has one. May be null.
     */
    public Biome getTransitionBiome() {
        return transitionBiome;
    }
}