private int getCardValue(card_rank rank) { switch (rank) { case card_rank.two: return(2); case card_rank.three: return(3); case card_rank.four: return(4); case card_rank.five: return(5); case card_rank.six: return(6); case card_rank.seven: return(7); case card_rank.eight: return(8); case card_rank.nine: return(9); case card_rank.ten: case card_rank.jack: case card_rank.queen: case card_rank.king: return(10); case card_rank.ace: return(11); } return(-1); }
public card_t(card_suit in_suit, card_rank in_rank) { string card_pic; suit = in_suit; rank = in_rank; value = getCardValue(rank); card_pic = "card_images/" + rank + "_of_" + suit; pic = new Sprite(); pic = Resources.Load <Sprite>(card_pic); }