📄 cardpiletableau.java
字号:
// File : CardPileTableau.java
// Purpose: Card pile with initial cards.
// Only need to specify rules for adding cards.
// Default rules apply to removing them.
// Author : Fred Swartz - February 27, 2007 - Placed in public domain.
package freecell;
//////////////////////////////////////////////////////////////////// Class
public class CardPileTableau extends CardPile {
//===================================================================== push
//... Accept card if pile is empty, or
// if face value is one lower and it's the opposite color.
@Override
public boolean rulesAllowAddingThisCard(Card card) {
if ((this.size() == 0) ||
(this.peekTop().getFace().ordinal() - 1 == card.getFace().ordinal() &&
this.peekTop().getSuit().getColor() != card.getSuit().getColor())) {
return true;
}
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -