//
//  CardGraphics.java
//  cribbage
//
//  Created by Nathan Haug on Mon Apr 26 2004.
//  Copyright (c) 2004 __MyCompanyName__. All rights reserved.
//
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;

public class CardGraphics {
	public static ImageIcon getCardGraphic (Card lookupCard) {
		String imagePath = "./images/";
		switch ( lookupCard.getRank() ) {
			case 1:
				imagePath += "A";
				break;
			case 11:
				imagePath += "J";
				break;
			case 12:
				imagePath += "Q";
				break;
			case 13:
				imagePath += "K";
				break;
			default:
				imagePath += lookupCard.getRank();
		}
		
		switch ( lookupCard.getSuit() ) {
			case 0:
				imagePath += "C";
				break;
			case 1:
				imagePath += "H";
				break;
			case 2:
				imagePath += "S";
				break;
			case 3:
				imagePath += "D";
				break;
		}
		imagePath += ".jpg";
	
		ImageIcon cardImage = new ImageIcon(imagePath);
		return cardImage;
	}
}
