2024-12-04 18:22:20 +00:00
|
|
|
import QtQuick
|
2024-12-05 00:22:18 +00:00
|
|
|
import Solitare
|
2024-12-04 18:22:20 +00:00
|
|
|
|
|
|
|
// Shows the top card facing down
|
|
|
|
// (or a blank card if the pile is empty)
|
|
|
|
CardModel {
|
|
|
|
card: GameState.drawPile.length > 0 ? GameState.drawPile[GameState.drawPile.length - 1] : null
|
|
|
|
isFaceDown: GameState.drawPile.length > 0 ? true : false
|
|
|
|
onClicked: {
|
2024-12-06 03:55:48 +00:00
|
|
|
if (GameState.drawNextCard()) {
|
|
|
|
if (GameState.isWinnable()) {
|
|
|
|
console.log("Still winnable")
|
|
|
|
} else {
|
|
|
|
console.warn("Game is lost")
|
|
|
|
}
|
|
|
|
}
|
2024-12-04 18:22:20 +00:00
|
|
|
}
|
|
|
|
}
|