import Foundation struct PlayerInfo: Codable, Equatable { /// The name of the player let name: PlayerName /// Indicates that the player is active, i.e. a session is established var isConnected = false /// The player is the next one to perform an action var isNextActor = false /// The card which the player added to the current trick var playedCard: CardId? = nil /// The height of the player card on the table stack var positionInTrick = 0 /// The number of times the player doubled the game cost (initial double and raises) var numberOfDoubles = 0 var leadsGame = false var state: [PlayerStateId] = [] init(name: PlayerName) { self.name = name } /// Convert the property names into shorter strings for JSON encoding enum CodingKeys: String, CodingKey { case name = "name" case isConnected = "connected" case isNextActor = "active" case playedCard = "card" case positionInTrick = "position" case numberOfDoubles = "doubles" case leadsGame = "leads" } }