jagafa.stats
Class CardTool

java.lang.Object
  extended by jagafa.stats.CardTool

public final class CardTool
extends java.lang.Object

CardTool contains some helper Methods to deal with cards and CardLists


Constructor Summary
CardTool()
           
 
Method Summary
static CardList getAllOfColor(CardList cards, int color)
          Get all Cards in the CardList with the color given
static CardList getValidCards(Hand hand, Board board, RuleSet rules)
          Get all Valid Cards out of the Hand for the board with the Ruleset specified
static boolean isBock(int nth, Card c, CardList gone, RuleSet rules)
          Check wether the card is a Bock of level n or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CardTool

public CardTool()
Method Detail

getAllOfColor

public static CardList getAllOfColor(CardList cards,
                                     int color)
Get all Cards in the CardList with the color given

Parameters:
cards - The source CardsList
color - The relevant color
Returns:
A CardList containing all Cards with the color specified from another CardList

isBock

public static boolean isBock(int nth,
                             Card c,
                             CardList gone,
                             RuleSet rules)
Check wether the card is a Bock of level n or not

Parameters:
nth - The level of the Bock
c - The card to check
gone - A CardList of all cards gone in the game
Returns:
True, if the Card can only be beaten by n(th) Cards left in the game

getValidCards

public static CardList getValidCards(Hand hand,
                                     Board board,
                                     RuleSet rules)
Get all Valid Cards out of the Hand for the board with the Ruleset specified

Parameters:
hand - The relevant hand
board - The relevant board
rules - The RuleSet to apply
Returns:
A CardList containing all card out of A hand which can be played onto the board


Copyright 2005 MA Software. All Rights Reserved.