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