Exemplo n.º 1
0
        public void OnNext(GameSeriesStarted started)
        {
            var deck = started.Plan.Deck;

            _cardIndices = deck.AllCards
                           .Select((Card, Index) => (Card, Index))
                           .ToDictionary(pair => pair.Card, pair => pair.Index);
            var minCardRank   = (int)deck[0].Rank;
            var plannedRounds = started.Plan.Rounds.Select(ConvertRoundSettingsToDto);
            var playerInfos   = started.Players.Select(p => new PlayerDto(p.Name, p.Type));
            var data          = new GameSeriesDto(started.GameUuid, minCardRank, playerInfos, plannedRounds);

            _client.GameSeriesStarted(data);
        }