private void executeAction(PlayerAction a){
		if(a == null) return;
		switch(a.type){
			case buy:
				selectedTowerDef = a.def;
				setInteractionState(InteractionState.placeTower);
				towerIsPlaceable = false;
				placeTowerLocation = transformPointBack(mousePos.x, mousePos.y).getPointI(a.def.size);
				break;
			case sell:
				level.removeTower(selectedTower);
				money += selectedTower.cumulativeCost / 2;
				selectedTower = null;
				setInteractionState(InteractionState.normal);
				break;
			case upgrade:
				selectedTowerDef = a.def;
				if(selectedTowerDef.cost > money) break;
				money -= selectedTowerDef.cost;
				Tower t = new Tower(a.def, selectedTower);
				level.removeTower(selectedTower);
				level.addTower(t);
				selectedTower = t;
				updateCommandCard();
				mouseMoved(mousePos.x, mousePos.y, mousePos.x, mousePos.y);
				break;
		}
	}