Added another utility method.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3484 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -141,6 +141,19 @@ public class TrickCardGameUtil
|
||||
return hand.getSuitMemberCount(cardsPlayed[0].card.getSuit()) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the specified array contains the given card.
|
||||
*/
|
||||
public static boolean containsCard (PlayerCard[] cards, Card card)
|
||||
{
|
||||
for (int i = 0; i < cards.length; i++) {
|
||||
if (cards[i].card.equals(card)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the number of cards that belong to the specified suit within
|
||||
* the array given.
|
||||
|
||||
Reference in New Issue
Block a user