From 86456b2441e959558b19775c27e2920e13dfd308 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Wed, 22 Dec 2021 22:12:31 +0100 Subject: [PATCH] Add points to player info --- Sources/App/GameSummary/SupportedLanguage.swift | 6 +++--- Sources/App/Infos/PlayerInfo.swift | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Sources/App/GameSummary/SupportedLanguage.swift b/Sources/App/GameSummary/SupportedLanguage.swift index 81b06b6..2fe5a59 100644 --- a/Sources/App/GameSummary/SupportedLanguage.swift +++ b/Sources/App/GameSummary/SupportedLanguage.swift @@ -1,8 +1,8 @@ import Foundation -enum SupportedLanguage { - case german - case english +enum SupportedLanguage: String, Codable { + case german = "german" + case english = "english" var gameSummarizer: GameSummarizer.Type { switch self { diff --git a/Sources/App/Infos/PlayerInfo.swift b/Sources/App/Infos/PlayerInfo.swift index c010839..9163001 100644 --- a/Sources/App/Infos/PlayerInfo.swift +++ b/Sources/App/Infos/PlayerInfo.swift @@ -5,6 +5,8 @@ struct PlayerInfo: Codable, Equatable { /// The name of the player let name: PlayerName + var points = 0 + /// Indicates that the player is active, i.e. a session is established var isConnected = false @@ -31,6 +33,7 @@ struct PlayerInfo: Codable, Equatable { /// Convert the property names into shorter strings for JSON encoding enum CodingKeys: String, CodingKey { case name = "name" + case points = "points" case isConnected = "connected" case isNextActor = "active" case playedCard = "card"