import Foundation struct PlayerInfo: Codable, Equatable { let name: PlayerName let connected: Bool /// The player is the next one to perform an action let active: Bool /// The cards in the hand of the player let cards: [CardInfo] /// The action the player can perform let actions: [String] init(player: Player, isMasked: Bool) { self.name = player.name self.connected = player.isConnected self.active = player.isNextActor if isMasked { self.cards = [] self.actions = [] } else { self.actions = player.actions.map { $0.path } self.cards = player.handCards.map { $0.cardInfo } } } }