package net.towerwarz;

import net.towerwarz.exception.UnknownObjectException;

import java.util.Arrays;

/**
 * TowerWarZ
 * Created by xiurobert on 2/14/2016.
 */


/**
 * This file is the init file and contains functions to set and retrieve certain game properties
 */
public class GameInstance {
    private int WaveNumber;
    private String difficulty;
    private String MapName;


    private String[] maps = {
            "GrassLands",
            "HellWorld",
            "IceLand",
            "DarkForest"

    };
    private String[] difficulties = {
            "Easy",
            "Normal",
            "Hard",
            "Sparta"
    };

    public GameInstance(String difficulty, int mapName){
        //starting game
        this.difficulty = difficulty;
        this.MapName = mapName;
        this.WaveNumber = 1;
        
        //load window
        //draw
        
        
    }


    public String setDifficulty(String diff) throws UnknownObjectException {
        if (Arrays.asList(difficulties).contains(diff)) { // Check if the difficulty is valid
            difficulty = diff; // Set difficulty
        } else {
            throw new UnknownObjectException("Invalid difficulty");
        }
        return difficulty;
    }

    public String getDifficulty() {
        return difficulty;
    }

    public String setMap(String map) throws UnknownObjectException {
        if (Arrays.asList(maps).contains(map)) {
            MapName = map;
        } else {
            throw new UnknownObjectException("Invalid map");
        }
        return MapName;
    }

    public String getMapName() {
        return MapName;
    }

    public int getWaveNumber() {
        return WaveNumber;
    }
}

@@ -652,258 +652,8 @@
 %7D;%0A%0A
-    public GameInstance(String difficulty, int mapName)%7B%0A        //starting game%0A        this.difficulty = difficulty;%0A        this.MapName = mapName;%0A        this.WaveNumber = 1;%0A        %0A        //load window%0A        //draw%0A        %0A        %0A    %7D%0A
 %0A%0A  

Revert "added constructor to gameInstance.java"