2024-12-04 18:26:16 +00:00
|
|
|
import QtQuick
|
2024-12-05 00:22:18 +00:00
|
|
|
import Solitare
|
2024-12-04 18:26:16 +00:00
|
|
|
|
|
|
|
Row {
|
2024-12-08 10:41:28 +00:00
|
|
|
id: foundationRow
|
|
|
|
|
|
|
|
required property real cardWidth
|
|
|
|
required property real cardHeight
|
|
|
|
|
|
|
|
spacing: cardWidth * 0.2
|
2024-12-04 18:26:16 +00:00
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: 4 // Each of the 4 suits
|
2024-12-05 02:24:09 +00:00
|
|
|
|
2024-12-07 22:19:44 +00:00
|
|
|
Item {
|
|
|
|
id: foundationPile
|
2024-12-08 10:41:28 +00:00
|
|
|
width: foundationRow.cardWidth
|
|
|
|
height: foundationRow.cardHeight
|
2024-12-07 22:19:44 +00:00
|
|
|
|
2024-12-05 00:22:18 +00:00
|
|
|
required property int index // passed from repeater
|
2024-12-05 02:24:09 +00:00
|
|
|
|
2024-12-07 22:19:44 +00:00
|
|
|
CardModel {
|
|
|
|
id: foundationCard
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: GameState.foundation[parent.index].length > 0
|
|
|
|
|
|
|
|
card: GameState.foundation[parent.index].length > 0 ? GameState.foundation[parent.index][0] : null
|
|
|
|
isFaceDown: false
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: emptyPileRect
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: GameState.foundation[parent.index].length === 0
|
|
|
|
|
|
|
|
color: "gray"
|
|
|
|
border.color: "white"
|
2024-12-08 10:41:28 +00:00
|
|
|
border.width: width * 0.03
|
2024-12-07 22:19:44 +00:00
|
|
|
opacity: 0.4
|
2024-12-08 10:41:28 +00:00
|
|
|
radius: width * 0.125
|
2024-12-07 22:19:44 +00:00
|
|
|
|
|
|
|
Text {
|
|
|
|
text: "A"
|
|
|
|
color: "white"
|
2024-12-08 10:41:28 +00:00
|
|
|
font.pixelSize: parent.width * 0.5
|
2024-12-07 22:19:44 +00:00
|
|
|
font.bold: true
|
|
|
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
2024-12-04 18:26:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|