|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BuildingRule
Implentations of this interface specify rules for building on the stack. Such constructs are common in solitaire games, where various rules apply to moving cards around the tableau, foundations, and so on.
Method Summary | |
---|---|
boolean |
canAddCard(CardStack stack,
Card add)
Determines whether the specified card can be added to the top of the stack. |
int |
canAddCards(CardStack stack,
CardStack add)
Determines whether cards can be moved from one stack to another. |
Method Detail |
---|
boolean canAddCard(CardStack stack, Card add)
stack
- the stack to add the card toadd
- the card to add
true
iff the card can be addedint canAddCards(CardStack stack, CardStack add)
0
if no cards can be moved. Note this method makes no
checks according to whether the required cards can all legally be moved
from the source stack, as this stack may be operating under different
rules.
stack
- the stack to move cards toadd
- the stack to move cards from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |