Format using tabs
This commit is contained in:
parent
1b0d06f20c
commit
43bf9f9adf
@ -19,10 +19,8 @@ public class FreeCellApplication extends Application {
|
||||
@Override
|
||||
public void start(Stage stage) throws Exception {
|
||||
VBox root = new VBox();
|
||||
root.setBackground(new Background(new BackgroundImage(new Image(
|
||||
"/deck/FELT.jpg"), BackgroundRepeat.NO_REPEAT,
|
||||
BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER,
|
||||
BackgroundSize.DEFAULT)));
|
||||
root.setBackground(new Background(new BackgroundImage(new Image("/deck/FELT.jpg"), BackgroundRepeat.NO_REPEAT,
|
||||
BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
|
||||
|
||||
Game game = new Game();
|
||||
GameMenuBar menuBar = new GameMenuBar();
|
||||
|
@ -42,8 +42,7 @@ public class Card {
|
||||
faceImages = new DoubleKeyedMap<>();
|
||||
}
|
||||
if (!faceImages.contains(rank, suit)) {
|
||||
faceImages.put(rank, suit, new Image("/deck/" + rank.value
|
||||
+ suit.firstLetter + ".png"));
|
||||
faceImages.put(rank, suit, new Image("/deck/" + rank.value + suit.firstLetter + ".png"));
|
||||
}
|
||||
return faceImages.get(rank, suit);
|
||||
}
|
||||
|
@ -29,8 +29,6 @@ public class MoveAction implements Action {
|
||||
return false;
|
||||
}
|
||||
MoveAction action = (MoveAction) other;
|
||||
return fromPile == action.fromPile
|
||||
&& toPile == action.toPile
|
||||
&& numCards == action.numCards;
|
||||
return fromPile == action.fromPile && toPile == action.toPile && numCards == action.numCards;
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,7 @@ public class Foundation extends AbstractPile {
|
||||
}
|
||||
Rank thisRank = topCard().rank;
|
||||
Suit thisSuit = topCard().suit;
|
||||
return otherSuit == thisSuit
|
||||
&& otherRank.value == thisRank.value + 1;
|
||||
return otherSuit == thisSuit && otherRank.value == thisRank.value + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +27,8 @@ public interface Pile extends Iterable<Card> {
|
||||
int moveFrom(Pile other);
|
||||
|
||||
/**
|
||||
* Moves cards from another pile to this pile, whether or not the tryMove is valid.
|
||||
* Moves cards from another pile to this pile, whether or not the tryMove is
|
||||
* valid.
|
||||
*/
|
||||
void moveFromBlindly(Pile other, int numCards);
|
||||
|
||||
|
@ -21,8 +21,7 @@ public class Tableau extends AbstractPile {
|
||||
private void countAddedCard(Card card) {
|
||||
if (isEmpty() || orderStack.isEmpty()) {
|
||||
orderStack.push(1);
|
||||
} else if (card.color != topCard().color &&
|
||||
card.rank.value == topCard().rank.value - 1) {
|
||||
} else if (card.color != topCard().color && card.rank.value == topCard().rank.value - 1) {
|
||||
orderStack.push(orderStack.pop() + 1);
|
||||
} else {
|
||||
orderStack.push(1);
|
||||
|
@ -6,9 +6,12 @@ import java.util.Map;
|
||||
/**
|
||||
* Maps a pair of coordinates to an object.
|
||||
*
|
||||
* @param <K1> the first coordinate
|
||||
* @param <K2> the second coordinate
|
||||
* @param <V> the treasure
|
||||
* @param <K1>
|
||||
* the first coordinate
|
||||
* @param <K2>
|
||||
* the second coordinate
|
||||
* @param <V>
|
||||
* the treasure
|
||||
*/
|
||||
public class DoubleKeyedMap<K1, K2, V> {
|
||||
|
||||
|
@ -41,8 +41,7 @@ public class CascadingPileView extends PileView {
|
||||
int multiplier = ((Tableau) pile).topInOrder();
|
||||
int heightOfRect = (multiplier - 1) * CARD_MARGIN;
|
||||
gc.setFill(highlight);
|
||||
gc.fillRect(x, yCurrent - heightOfRect, Card.width, heightOfRect
|
||||
+ Card.height);
|
||||
gc.fillRect(x, yCurrent - heightOfRect, Card.width, heightOfRect + Card.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user