34 lines
1.1 KiB
QML
34 lines
1.1 KiB
QML
import QtQuick
|
|
import Solitare
|
|
|
|
// In solitare, Tableau refers to the part of the board where all of the columns are placed
|
|
Row {
|
|
spacing: 10
|
|
|
|
Repeater {
|
|
model: GameState.columns.length
|
|
|
|
delegate: Column {
|
|
required property int index // passed from repeater
|
|
|
|
spacing: -80 // Overlap
|
|
|
|
Repeater {
|
|
model: GameState.columns[parent.index].length > 0 ? GameState.columns[parent.index].length : 1 // Render an empty slot for an empty column
|
|
|
|
delegate: CardModel {
|
|
required property int index
|
|
property ColumnSlot col: GameState.columns[parent.index].length > 0 ? GameState.columns[parent.index][index] : null // empty column (single empty slot)
|
|
|
|
card: col ? col.card : null
|
|
isFaceDown: col ? !col.revealed : false
|
|
onClicked: {
|
|
if (col && col.revealed)
|
|
GameState.autoMoveColumnCard(parent.index, index);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|