/*so far, calss has:  makeDeck
		      isEquealTo
		      comapreValue

it needs: deal
	  discard \
		    trade?
	  pickup  /

perhaps we could make a Golfgame class...an instance for each game
we could make a bunch of game classes each having methods specific to the 
game...interesting..
and all could inherit cards....
*/	

import java.util.*;
class Card
{
	int value;
	char suit;
	int points;//point value, depends on the game being played (EX K = 13, A = 1 0r 14 ect)
	int number;
	static Vector deck = new Vector(53); //deck of cards, used in the 

	
	//createDeck method
	//constructors
	
	//defalut
	public Card()
	{
		value = 0;
		suit = 'H';
		points = 0;
		number = 0;
		// initialise vector?
	}

//************************| METHODS |****************************************
	
	//getters and setters
	
	//getters

	public int getValue()
	{
		return this.value;
	}
	
	public int getPoints()
	{
		return this.points;
	}

	public int getNumber()
	{
		return this.number;
	}
	
	public char getSuit()
	{
		return this.suit;
	}
	
	//setters

	public void setValue(int v)
	{
		this.value = v;
	}
	
	public void setPoints(int p)
	{
		this.points = p;
	}
	
	public void setNumber(int n)
	{
		this.number = n;
	}

	public void setSuit(char s)
	{
		this.suit = s;
	}
	//end of setters and getters

	// isEquealTO compares 2 cards and returns a 0 if the 
	// values and suit are the same, a -1 if the values are 
	// the same and the suit is diffrent, a -2 
	// if the values are diffrent and the suit is the same.
	// and a -3 if both the values and suit are difrrent
	
	
	public int isEquealTo(Card b)
	{
		int same = 0;

		if ((this.value == b.value) && (this.suit == b.suit))
		{
			same = 0;
		}

		else if ((this.value == b.value) && (this.suit != b.suit))
		{
			same = -1;
		}

		else if ((this.value != b.value) && (this.suit == b.suit))
		{
			same = -2;
		}

		else if ((this.value != b.value) && (this.suit != b.suit))
		{
			same = -3;
		}
		
		return same;
	}
	
	// compareValue compares the vlaues of 2 cards 
	// use after isEquealTo to see if this.values is 
	// greater(1) equeal(0) or less than(-1) the argument  
	
	public int compareValue(int a)
	{
		int ans;		

		if (this.value == a)
		{
			ans = 0;
		}
		else if (this.value > a)
		{
			ans = 1;
		}
		else
		{
			ans = -1;
		}
		
		return ans;
	}





	
	// makeDeck initialises a deck of 52 cards (deck without jokers) 
	// the same as a normal deck except it also makes
	// a blank card as a place holder which is at the end
	
	public static void makeDeck(Vector Deck)  // <------ this method has troubles with vectors...CHECK!!
	{
		int number = 0;//the number card out of 52	
		char suit; //the current suit
		int changesuit = 0;//decides the current suit		
		

		//loops 4 times, 1 for each suit
		for(int k = 0; k <= 4; k++)
		{	
			changesuit++;
			
			//loops 13 times, each time creating a card in vector deck
			for(int i = 0; i <= 13; i++)
			{	
				number++;
				
				Card temp = new Card();
				
				 
				//assigns a number out of 52 to each card
		
				temp.setNumber(number);

				//assigns a value to each card (1-13)
				temp.setValue(i++);

				//assigns a point value to each card
				//in this case it happens to match face value
				temp.setPoints(i);
				
				//decides which suit to use
				if (changesuit == 1)
				{	
					suit = 'S';
				} else if (changesuit == 2)
				{	
					suit = 'C';
				} else if (changesuit == 3)
				{	
					suit = 'H';
				} else 	{	
					suit = 'D';
				}

				temp.setSuit(suit);
				deck.setElementAt(temp, i);
			}
			
		}
		}
	}

