import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JButton;

public class GameCard extends JButton {

	/**
	 * 
	 */
	private Color myColor;
	private static Color defaultColor = Color.DARK_GRAY;
	
	private static int width = 100, height = 100;
	

	public GameCard(Color c) {
		myColor = c;
		setPreferredSize(new Dimension(width, height));
		faceDown();
	}
	
	public void faceUp() {
		// TODO Auto-generated method stub
		setBackground(myColor);
		paintImmediately(0, 0, getWidth(), getHeight());

	}
	
	public void faceDown() {
		setBackground(defaultColor);
		paintImmediately(0, 0, getWidth(), getHeight());
		
	}

	public Color getColor() {
		return myColor;
	}

	//returns true if the card is face up, false otherwise
	public boolean isFaceUp() {
		return getBackground() == myColor;
	}
	
}
