//
//
//  Generated by StarUML(tm) Java Add-In
//
//  @ Project : Poker Five Card Draw
//  @ File Name : Card.java
//  @ Date : 1/26/2015
//  @ Author : Pepper
//
//
/**
 * The Card class represents a single card. 
 * 
 **/
public class Card {
    private int rank;
    private String suit;
    /**
     * builds a new card
     *
     * @param    rank  card ranking with valid values: 1-13 (1 = A; 11 = J; 12 = Q; 13 = K)
     * @param    suit  Suit valid values: Heart, Spade, Club, Diamond (all caps)
     **/
    public Card(int rank, String suit) {
        this.rank = rank;
        this.suit = suit;
    }

    /**
     * 
     * @return    a string such as Ace of Hearts or 2 of hearts
     **/
    public String toString() {
        return getRankName() + " of " + this.suit;

    }

    /**
     * Figures out the numeric value of a card
     * 
     * @return    a number representing the card score: A = 1; J = 11; Q = 12; K = 13; otherwise the number
     **/
    public int getcardScore() {
        return this.rank;
    }
    /**
     * Returns the full name of face cards  
     *
     * @return   the full name of face cards A = Ace; J = Jack; Q = Queen; K = King 2 - 10
     **/
    public String getRankName() {

        if (this.rank == 1) { return "Ace";}
        else if (this.rank == 11) { return "Jack";}
        else if (this.rank == 12) { return "Queen";}
        else if (this.rank == 13) { return "King";}
        else { return "" +   (char)( 49 + this.rank);}
    }
}
