package com.eyeofmidas.cardtrick;

import com.badlogic.gdx.math.Vector2;
import com.eyeofmidas.cardtrick.InputScreen.DragDirection;

public class CardTranslator {
	public static CharSequence translate(Vector2 position, DragDirection direction) {
		return getCard(position) + " of " + getSuit(direction);
	}

	private static CharSequence getCard(Vector2 position) {
		CharSequence card = "";
		if (position.x == 0 && position.y == 0) {
			card = "2";
		}
		if (position.x == 1 && position.y == 0) {
			card = "3";
		}
		if (position.x == 2 && position.y == 0) {
			card = "4";
		}
		if (position.x == 3 && position.y == 0) {
			card = "5";
		}
		if (position.x == 0 && position.y == 1) {
			card = "6";
		}
		if (position.x == 1 && position.y == 1) {
			card = "7";
		}
		if (position.x == 2 && position.y == 1) {
			card = "8";
		}
		if (position.x == 3 && position.y == 1) {
			card = "9";
		}
		if (position.x == 0 && position.y == 2) {
			card = "10";
		}
		if (position.x == 1 && position.y == 2) {
			card = "Jack";
		}
		if (position.x == 2 && position.y == 2) {
			card = "Queen";
		}
		if (position.x == 3 && position.y == 2) {
			card = "King";
		}
		if (position.y == 3) {
			card = "Ace";
		}

		return card;
	}

	private static CharSequence getSuit(DragDirection direction) {
		CharSequence suit = "";
		if (direction == DragDirection.DOWN) {
			suit = "Hearts";
		}
		if (direction == DragDirection.LEFT) {
			suit = "Diamonds";
		}
		if (direction == DragDirection.UP) {
			suit = "Spades";
		}
		if (direction == DragDirection.RIGHT) {
			suit = "Clubs";
		}
		return suit;
	}
}