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 }; }) }); }
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() }); }