public class Action {

	// =======================================
	public static Action capturer = new Action(Interface.COUT_CAPTURE, 0);
	public static Action bouclier = new Action(Interface.COUT_BOUCLIER, 1);
	public static Action lien = new Action(Interface.COUT_LIEN, 2);
	public static Action neutralisation = new Action(
			Interface.COUT_NEUTRALISATION, 3);
	public static Action turbo = new Action(Interface.Cou, 4);
	// =======================================
	
	public enum Type{
		capturer, bouclier, lien, neutralisation, turbo;
	}

	public int type;
	public Position pos;

	public Action(Type type) {
		this.type = type;
	}

	public Action(int type, Position pos) {
		this.type = type;
		this.pos = pos;
	}

	public int getCost() {
		switch (type) {
		case 0:
			return Interface.COUT_CAPTURE;
		case 1:
			return Interface.COUT_BOUCLIER + Interface.portail_boucliers(pos);
		case 2:
			return Interface.COUT_LIEN;
		case 3:
			return Interface.COUT_NEUTRALISATION
					+ (Interface.portail_boucliers(pos) * Interface.COUT_NEUTRALISATION_BOUCLIER);
		case 4:
			return Interface.COUT_TURBO;
		}
		return 0;
	}

	public Erreur makeAction() {
		switch (type) {
		case 0:
			return Interface.capturer();
		case 1:
			return Interface.ajouter_bouclier();
		case 2:
			return Interface.lier(pos);
		case 3:
			return Interface.neutraliser();
		case 4:
			return Interface.utiliser_turbo();
		}
		return null;
	}

}
