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:
Andrzej Kapolka
2005-04-13 22:57:43 +00:00
parent 69cd0b41a7
commit ffbf3f7082
@@ -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.