package rpgEngine.Data.Abstract;

import java.util.ArrayList;
import java.util.List;

import rpgEngine.Data.Abstract.Enemy.EnemyParty;
import rpgEngine.Data.Abstract.NPC.ScriptPlayer;
import rpgEngine.Data.Abstract.Party.HumanPlayer;
import rpgEngine.Data.Abstract.Party.Inventory;
import rpgEngine.Data.Abstract.World.Map;

public class Game {
	public static final Integer VARIABLE_LIMIT = 10000;
	
	private List<HumanPlayer> party;
	private Integer gold;
	private Inventory inventory;
	private List<Boolean> variables;
	
	private Map activeMap;
	private ScriptPlayer activeScript;
	private Shop activeShop;
	private EnemyParty activeEnemyParty;
	
	
	
	public Game() {
		party = new ArrayList<HumanPlayer>();
		
		activeMap = null;
		activeScript = null;
		activeShop = null;
		setActiveEnemyParty(null);
		
		inventory = new Inventory();
		gold = 0;
		
		variables = new ArrayList<Boolean>();
		
		for(Integer i = 0; i < VARIABLE_LIMIT; i++) {
			variables.add(false);
		}
	}

	
	public Boolean getVariable(Integer i) {
		try {
			return variables.get(i);
		}
		catch(Exception e) {
			return false;
		}
	}

	public void setVariable(Integer i, Boolean v) {
		try {
			variables.set(i, v);
		}
		catch(Exception e) {
			//do nothing
		}
	}

	public List<HumanPlayer> getParty() {
		return party;
	}

	public Map getActiveMap() {
		return activeMap;
	}

	public void setActiveMap(Map activeMap) {
		this.activeMap = activeMap;
	}

	public Integer getGold() {
		return gold;
	}

	public void setGold(Integer gold) {
		this.gold = gold;
	}

	public Inventory getInventory() {
		return inventory;
	}

	public void setActiveScript(ScriptPlayer s) {
		activeScript = s;
	}
	
	public ScriptPlayer getActiveScript() {
		return activeScript;
	}


	public Shop getActiveShop() {
		return activeShop;
	}


	public void setActiveShop(Shop activeShop) {
		this.activeShop = activeShop;
	}


	public EnemyParty getActiveEnemyParty() {
		return activeEnemyParty;
	}


	public void setActiveEnemyParty(EnemyParty activeEnemyParty) {
		this.activeEnemyParty = activeEnemyParty;
	}
	
}
