package com.bernard.greposimu.model;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.bernard.greposimu.Utils;

public class DefContext {
	// unitID -> number of units
	public Map<String, Integer> units;
	
	public String hero;
	public int heroLevel;
	
	public int wallLevel;
	public boolean hasTower;
	
	public Set<String> powers;
	public Set<String> researches;
	
	public Set<String> counsellors;
	
	public boolean nightBonus;
	
	public DefContext() {
		this.units = new HashMap<>();
		this.hero = null;
		this.heroLevel = 0;
		this.wallLevel = 0;
		this.hasTower = false;
		this.powers = new HashSet<>();
		this.researches = new HashSet<>();
		this.counsellors = new HashSet<>();
		this.nightBonus = false;
	}

	public Map<String, Integer> getUnits() {
		return units;
	}

	public String getHero() {
		return hero;
	}

	public int getHeroLevel() {
		return heroLevel;
	}

	public int getWallLevel() {
		return wallLevel;
	}

	public boolean isHasTower() {
		return hasTower;
	}

	public Set<String> getPowers() {
		return powers;
	}

	public Set<String> getResearches() {
		return researches;
	}

	public Set<String> getCounsellors() {
		return counsellors;
	}
	
	public Map<String, Boolean> getPowersAsMap() {
		return Utils.setToMap(powers);
	}

	public Map<String, Boolean> getResearchesAsMap() {
		return Utils.setToMap(researches);
	}

	public Map<String, Boolean> getCounsellorsAsMap() {
		return Utils.setToMap(counsellors);
	}	

	public boolean isNightBonus() {
		return nightBonus;
	}
	
	

	public void setHero(String hero) {
		this.hero = hero;
	}

	public void setHeroLevel(int heroLevel) {
		this.heroLevel = heroLevel;
	}

	public void setWallLevel(int wallLevel) {
		this.wallLevel = wallLevel;
	}

	public void setHasTower(boolean hasTower) {
		this.hasTower = hasTower;
	}

	public void setNightBonus(boolean nightBonus) {
		this.nightBonus = nightBonus;
	}

	@Override
	public String toString() {
		return "DefContext [units=" + units + ", heros=" + hero + ", herosLevel=" + heroLevel + ", wallLevel="
				+ wallLevel + ", hasTower=" + hasTower + ", powers=" + powers + ", researches=" + researches
				+ ", counsellors=" + counsellors + ", nightBonus=" + nightBonus + "]";
	}
	
	
	
}
