I have the following init statement for my NSObject class, KCCard.
- (id)initWithValue:(NSInteger)aValue suit:(Suit)aSuit {
if (self = [super init]) {
self.suit = aSuit;
self.value = aValue;
}
return self;
}
Suit is either Clubs, Spades, Diamonds, or Hearts.
Value is 1 through 13.
My problem is that the values 11 through 13 are Jack, Queen, and King. But for a Blackjack game, their values are all worth 10. But if I set the cards value to 10, it thinks that the card is a 10 and when I get the image for the card, a 10 image is shown.
How can I make it so it knows that 11 through 13 are worth 10, but not interfere with the image of the card?
Thanks!
Just simply write one more function to get the actual value. For example
So you use this function to check the value