// Path: src/model/Card.java
// public enum Card {
// 
// 	KNIGHT(CardType.UNIT), 
// 	ARCHER(CardType.UNIT), 
// 	CLERIC(CardType.UNIT), 
// 	WIZARD(CardType.UNIT), 
// 	NINJA(CardType.UNIT),
// 	INFERNO(CardType.SPELL), 
// 	REVIVE_POTION(CardType.ITEM), 
// 	RUNEMETAL(CardType.ITEM), 
// 	SCROLL(CardType.ITEM), 
// 	DRAGONSCALE(CardType.ITEM), 
// 	SHINING_HELM(CardType.ITEM), 
// 	CRYSTAL(CardType.UNIT);
// 	
// 	public final CardType type;
// 	
// 	Card(CardType type) {
// 		this.type = type;
// 	}
// 	
// }
// 
// Path: src/model/HaMap.java
// public class HaMap {
// 
// 	public String name;
// 	public int width;
// 	public int height;
// 	public SquareType[][] squares;
// 	public List<Position> assaultSquares;
// 	public List<Position> p1DeploySquares;
// 	public List<Position> p2DeploySquares;
// 	public List<Position> p1Crystals;
// 	public List<Position> p2Crystals;
// 
// 	public HaMap(int width, int height, SquareType[][] squares, String name) {
// 		super();
// 		this.name = name;
// 		this.width = width;
// 		this.height = height;
// 		this.squares = squares;
// 		assaultSquares = new ArrayList<Position>();
// 		p1DeploySquares = new ArrayList<Position>();
// 		p2DeploySquares = new ArrayList<Position>();
// 		p1Crystals = new ArrayList<Position>();
// 		p2Crystals = new ArrayList<Position>();
// 		for (int x = 0; x < squares.length; x++)
// 			for (int y = 0; y < squares[0].length; y++) {
// 				if (squares[x][y] == SquareType.DEPLOY_1)
// 					p1DeploySquares.add(new Position(x, y));
// 				if (squares[x][y] == SquareType.DEPLOY_2)
// 					p2DeploySquares.add(new Position(x, y));
// 				if (squares[x][y] == SquareType.ASSAULT)
// 					assaultSquares.add(new Position(x, y));
// 			}
// 	}
// 
// 	public SquareType squareAt(int x, int y) {
// 
// 		return squares[x][y];
// 
// 	}
// 
// 	public SquareType squareAt(Position position) {
// 		return squareAt(position.x, position.y);
// 	}
// 
// }
// 
// Path: src/model/Position.java
// public class Position {
// 
// 	public int x;
// 	public int y;
// 
// 	public Position(int x, int y) {
// 		super();
// 		this.x = x;
// 		this.y = y;
// 	}
// 
// 	public Position() {
// 		super();
// 		x = 0;
// 		y = 0;
// 	}
// 
// 	public Direction getDirection(Position pos) {
// 		if (pos == null)
// 			return null;
// 		return Direction.direction(pos.x - x, pos.y - y);
// 	}
// 
// 	public int hashCode() {
// 		int result = 1;
// 		result = 5 * result + x;
// 		result = 5 * result + y;
// 		return result;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "(" + x + "," + y + ")";
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		final Position other = (Position) obj;
// 		if (x != other.x)
// 			return false;
// 		if (y != other.y)
// 			return false;
// 		return true;
// 	}
// 
// 	public int distance(Position to) {
// 		int xx = x - to.x;
// 		if (xx < 0)
// 			xx = xx * (-1);
// 		int yy = y - to.y;
// 		if (yy < 0)
// 			yy = yy * (-1);
// 		return xx + yy;
// 	}
// 
// }


import java.util.HashMap;
import java.util.Map;
import model.Card;
import model.HaMap;
import model.Position;
package action;



public class SingletonAction {

	public static final EndTurnAction endTurnAction = new EndTurnAction();
	public static final PlayAgainAction playAgainAction = new PlayAgainAction();
	public static final UndoAction undoAction = new UndoAction();
	public static final Map<Card, SwapCardAction> swapActions = new HashMap<Card, SwapCardAction>();
	static {
		swapActions.put(Card.ARCHER, new SwapCardAction(Card.ARCHER));
		swapActions.put(Card.CLERIC, new SwapCardAction(Card.CLERIC));
		swapActions.put(Card.DRAGONSCALE, new SwapCardAction(Card.DRAGONSCALE));
		swapActions.put(Card.INFERNO, new SwapCardAction(Card.INFERNO));
		swapActions.put(Card.KNIGHT, new SwapCardAction(Card.KNIGHT));
		swapActions.put(Card.NINJA, new SwapCardAction(Card.NINJA));
		swapActions.put(Card.REVIVE_POTION, new SwapCardAction(
				Card.REVIVE_POTION));
		swapActions.put(Card.RUNEMETAL, new SwapCardAction(Card.RUNEMETAL));
		swapActions.put(Card.SCROLL, new SwapCardAction(Card.SCROLL));
		swapActions.put(Card.SHINING_HELM,
				new SwapCardAction(Card.SHINING_HELM));
// Path: src/model/Card.java
// public enum Card {
// 
// 	KNIGHT(CardType.UNIT), 
// 	ARCHER(CardType.UNIT), 
// 	CLERIC(CardType.UNIT), 
// 	WIZARD(CardType.UNIT), 
// 	NINJA(CardType.UNIT),
// 	INFERNO(CardType.SPELL), 
// 	REVIVE_POTION(CardType.ITEM), 
// 	RUNEMETAL(CardType.ITEM), 
// 	SCROLL(CardType.ITEM), 
// 	DRAGONSCALE(CardType.ITEM), 
// 	SHINING_HELM(CardType.ITEM), 
// 	CRYSTAL(CardType.UNIT);
// 	
// 	public final CardType type;
// 	
// 	Card(CardType type) {
// 		this.type = type;
// 	}
// 	
// }
// 
// Path: src/model/HaMap.java
// public class HaMap {
// 
// 	public String name;
// 	public int width;
// 	public int height;
// 	public SquareType[][] squares;
// 	public List<Position> assaultSquares;
// 	public List<Position> p1DeploySquares;
// 	public List<Position> p2DeploySquares;
// 	public List<Position> p1Crystals;
// 	public List<Position> p2Crystals;
// 
// 	public HaMap(int width, int height, SquareType[][] squares, String name) {
// 		super();
// 		this.name = name;
// 		this.width = width;
// 		this.height = height;
// 		this.squares = squares;
// 		assaultSquares = new ArrayList<Position>();
// 		p1DeploySquares = new ArrayList<Position>();
// 		p2DeploySquares = new ArrayList<Position>();
// 		p1Crystals = new ArrayList<Position>();
// 		p2Crystals = new ArrayList<Position>();
// 		for (int x = 0; x < squares.length; x++)
// 			for (int y = 0; y < squares[0].length; y++) {
// 				if (squares[x][y] == SquareType.DEPLOY_1)
// 					p1DeploySquares.add(new Position(x, y));
// 				if (squares[x][y] == SquareType.DEPLOY_2)
// 					p2DeploySquares.add(new Position(x, y));
// 				if (squares[x][y] == SquareType.ASSAULT)
// 					assaultSquares.add(new Position(x, y));
// 			}
// 	}
// 
// 	public SquareType squareAt(int x, int y) {
// 
// 		return squares[x][y];
// 
// 	}
// 
// 	public SquareType squareAt(Position position) {
// 		return squareAt(position.x, position.y);
// 	}
// 
// }
// 
// Path: src/model/Position.java
// public class Position {
// 
// 	public int x;
// 	public int y;
// 
// 	public Position(int x, int y) {
// 		super();
// 		this.x = x;
// 		this.y = y;
// 	}
// 
// 	public Position() {
// 		super();
// 		x = 0;
// 		y = 0;
// 	}
// 
// 	public Direction getDirection(Position pos) {
// 		if (pos == null)
// 			return null;
// 		return Direction.direction(pos.x - x, pos.y - y);
// 	}
// 
// 	public int hashCode() {
// 		int result = 1;
// 		result = 5 * result + x;
// 		result = 5 * result + y;
// 		return result;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "(" + x + "," + y + ")";
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		final Position other = (Position) obj;
// 		if (x != other.x)
// 			return false;
// 		if (y != other.y)
// 			return false;
// 		return true;
// 	}
// 
// 	public int distance(Position to) {
// 		int xx = x - to.x;
// 		if (xx < 0)
// 			xx = xx * (-1);
// 		int yy = y - to.y;
// 		if (yy < 0)
// 			yy = yy * (-1);
// 		return xx + yy;
// 	}
// 
// }


// Path: src/action/SingletonAction.java
import java.util.HashMap;
import java.util.Map;
import model.Card;
import model.HaMap;
import model.Position;

package action;



public class SingletonAction {

	public static final EndTurnAction endTurnAction = new EndTurnAction();
	public static final PlayAgainAction playAgainAction = new PlayAgainAction();
	public static final UndoAction undoAction = new UndoAction();
	public static final Map<Card, SwapCardAction> swapActions = new HashMap<Card, SwapCardAction>();
	static {
		swapActions.put(Card.ARCHER, new SwapCardAction(Card.ARCHER));
		swapActions.put(Card.CLERIC, new SwapCardAction(Card.CLERIC));
		swapActions.put(Card.DRAGONSCALE, new SwapCardAction(Card.DRAGONSCALE));
		swapActions.put(Card.INFERNO, new SwapCardAction(Card.INFERNO));
		swapActions.put(Card.KNIGHT, new SwapCardAction(Card.KNIGHT));
		swapActions.put(Card.NINJA, new SwapCardAction(Card.NINJA));
		swapActions.put(Card.REVIVE_POTION, new SwapCardAction(
				Card.REVIVE_POTION));
		swapActions.put(Card.RUNEMETAL, new SwapCardAction(Card.RUNEMETAL));
		swapActions.put(Card.SCROLL, new SwapCardAction(Card.SCROLL));
		swapActions.put(Card.SHINING_HELM,
				new SwapCardAction(Card.SHINING_HELM));
		swapActions.put(Card.WIZARD, new SwapCardAction(Card.WIZARD));