using System.Collections;
using System.Collections.Generic;

public class Loadout {
	private string name;
	private Dictionary<Class, int> ammo;

	public Loadout(string name) {
		this.name = name;
		ammo = new Dictionary<Class, int>();
	}

	public void addAmmo(Class ammoClass, int count) {
		ammo[ammoClass] = count;
	}

	public string getName() {
		return name;
	}

	public Dictionary<Class, int> getAmmo() {
		return ammo;
	}
}

public class LoadoutData {
	private Dictionary<Class, int> ammo;

	public LoadoutData(Loadout loadout) {
		if (loadout == null) {
			ammo = new Dictionary<Class, int>();
		}
		else {
			ammo = new Dictionary<Class, int>(loadout.getAmmo());
		}
	}

	public Dictionary<Class, int> getAmmo() {
		return new Dictionary<Class, int>(ammo);
	}

	public void removeAmmo(Class unitClass, int loaded) {
		ammo[unitClass] -= loaded;
	}

	public bool isEmpty() {
		foreach(KeyValuePair<Class, int> pair in ammo) {
			if (pair.Value > 0) {
				return false;
			}
		}

		return true;
	}
}
