public ActionManager(Unit unit, Game.ActionType action)	//Contents modified by Nick Lee 16-9-14
	{
		GameObject gameController = GameObject.FindWithTag ("GameController");
		game = gameController.GetComponent<Game> ();
		//gets local game controller
		actionUsed = action; //gets the action
		this.unit = unit; //the unit using the action
		marines = game.gameMap.getUnits (Game.EntityType.SM);
		makePrevLoS ();
	}
	private void makeActions(Game.ActionType actionMade, Unit exe) //Created by Nick Lee 23-9-14, modified 5-11-14
	{
		executor = exe;
		actionType = actionMade; //gets action made
		finishLoS ();
		//gets the updated LoS for all marines
		APCost = UnitData.getAPCost(actionType); //gets the AP cost of the action
		if (overwatchShot)
			APCost = 0;

		if (actionType == Game.ActionType.Move) {
			executie = null; //no target unit for moving
			movePosition = moving; //position to move to set by moving
			moveFacing = compassFacing; //facing set by compass facing
			if(!sittingStill)
				APCost = UnitData.getMoveSet(executor.unitType)[Movement]; //APCost depends on type of movement
			else
			{
				APCost = 0;
				sittingStill = false;
			}
			unitJams = false; //cant jam
			voidSustainedFire(executor);
			voidOverwatch(executor);
		}
		else if (actionType == Game.ActionType.Attack) {
			voidOverwatch(executor);
			voidOverwatch(executie);
			movePosition = executor.position; //no position change
			moveFacing = executor.facing; //no facing change
			voidSustainedFire(executor);
			voidSustainedFire(executie);
			unitJams = false;
		}
		else if (actionType == Game.ActionType.Shoot) {
			movePosition = executor.position; //position unchanged
			moveFacing = executor.facing; //facing unchanged
		}
		else if (actionType == Game.ActionType.ToggleDoor) {
			voidSustainedFire(executor);
			voidOverwatch(executor);
			unitJams = false;
		}
		else if (actionType == Game.ActionType.Overwatch) {
			executie = null; //no target unit
			movePosition = executor.position; //no change movement
			moveFacing = executor.facing; //no change in facing
			unitJams = false; //no jamming
		} else
			Debug.Log ("Error with action type , ActionManager, makeActions");
		//error message and catching

		returnAction.actionType = actionType;
		returnAction.executor = executor;
		returnAction.target = executie;
		returnAction.movePosition = movePosition;
		returnAction.moveFacing = moveFacing;
		returnAction.APCost = APCost;
		returnAction.unitJams = unitJams;
		returnAction.destroyedUnits = destroyedUnits;
		returnAction.sustainedFireLost = sustainedFireLost;
		returnAction.completeLoS = completeLoS;
		returnAction.prevLoS = prevLoS;
		returnAction.sustainedFireChanged = sustainedFireChanged;
		returnAction.lostOverwatch = lostOverwatch;
		returnAction.diceRoll = dieRolled;
		actions.Add (returnAction);
		//creates a return Action and adds it to the list of actions
		
		resetVariables ();
	}