예제 #1
0
        public PartialGameState GetPartialGameState()
        {
            return(new PartialGameState
            {
                PartialVoteStates = CurrentVotingOptions.Select(x =>
                {
                    var votesForOption = CurrentVotes.Values.Count(y => y == x.Id);

                    return new PartialVoteState
                    {
                        Id = x.Id,
                        Count = votesForOption
                    };
                })
            });
        }
예제 #2
0
        public CompleteGameState GetCompleteGameState()
        {
            return(new CompleteGameState
            {
                PreviousResultDescription = PreviousVoteDescription,
                CurrentRound = _currentVotingRound,
                VoteOptionsState = CurrentVotingOptions.Select(x =>
                {
                    var votesForOption = CurrentVotes.Values.Count(y => y == x.Id);

                    return new FullVoteOptionState
                    {
                        Description = x.Description,
                        Id = x.Id,
                        Count = votesForOption
                    };
                }).ToArray()
            });
        }