public ChallengeScoreboard(IChallengePayout payout, IDictionary <UserId, decimal?> scoreboard) : base(scoreboard.OrderByDescending(item => item.Value)) { PayoutBuckets = payout.Buckets; PayoutPrizePoolCurrencyType = payout.PrizePool.Type; var participants = this.Where(x => x.Value != null).Select(item => item.Key).ToList(); Winners = new Queue <UserId>(participants.Take(payout.Entries)); Losers = new List <UserId>(participants.Skip(payout.Entries)); }
public Challenge(ChallengeId challengeId, IChallengePayout payout) { this.SetEntityId(challengeId); Payout = payout; }