|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object smithers.cards.AbstractBuildingRule smithers.cards.BuildingUpBySuits
public class BuildingUpBySuits
A building rule which allows a card to be placed if it is the same suit as, and one rank higher than, the top card. Only aces may be placed in an empty space.
Field Summary |
---|
Fields inherited from class smithers.cards.AbstractBuildingRule |
---|
canAddMultiple |
Constructor Summary | |
---|---|
BuildingUpBySuits()
Constructs a new instance of this rule. |
Method Summary | |
---|---|
boolean |
goesInSpace(Card c)
Determines whether the specified card can be placed in an empty space. |
boolean |
goesOn(Card c1,
Card c2)
Determines whether card c2 can be placed on top of card c1 . |
Methods inherited from class smithers.cards.AbstractBuildingRule |
---|
canAddCard, canAddCards |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BuildingUpBySuits()
Method Detail |
---|
public boolean goesOn(Card c1, Card c2)
c2
can be placed on top of card c1
.
goesOn
in class AbstractBuildingRule
c1
- the card to move ontoc2
- the card to be moved
true
iff the card can be movedpublic boolean goesInSpace(Card c)
goesInSpace
in class AbstractBuildingRule
c
- the card to be moved
true
iff the card can be moved into a space
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |