Fix card display on finished table

This commit is contained in:
Christoph Hagen 2021-12-22 15:06:24 +01:00
parent dbac55e15d
commit 788222a19a

View File

@ -8,6 +8,9 @@ final class FinishedTable: AbstractTable<FinishedPlayer> {
let leadingTrumps: Int
/// Required for the last cards on the table
let indexOfTrickStarter: Int
var cost: Int {
guard !isBettel else {
return game.basicCost * 2^^totalNumberOfDoubles
@ -77,6 +80,7 @@ final class FinishedTable: AbstractTable<FinishedPlayer> {
let selector = table.players.first { $0.selectsGame }!
self.game = table.game
self.totalNumberOfDoubles = table.totalNumberOfDoubles
self.indexOfTrickStarter = table.indexOfTrickStarter
defer {
for player in winners {
player.isNextActor = true
@ -129,4 +133,8 @@ final class FinishedTable: AbstractTable<FinishedPlayer> {
info.summary = GameSummary(table: self, language: language)
return info
}
override func cardStackPosition(ofPlayerAt index: Int) -> Int {
(4 + index - indexOfTrickStarter) % 4
}
}