示例#1
0
 public Challenge(
     ChallengeId id,
     ChallengeName name,
     Game game,
     BestOf bestOf,
     Entries entries,
     ChallengeTimeline timeline,
     IScoring scoring
     )
 {
     this.SetEntityId(id);
     Name     = name;
     Game     = game;
     BestOf   = bestOf;
     Entries  = entries;
     Timeline = timeline;
     Scoring  = scoring;
     this.AddDomainEvent(new ChallengeCreatedDomainEvent(this));
 }
示例#2
0
 internal ParticipantScore(Participant participant, BestOf bestOf) : base(participant.Matches.OrderByDescending(match => match.Score).Take(bestOf).Average(match => match.Score.ToDecimal()))
 {
 }
示例#3
0
 public Score?ComputeScore(BestOf bestOf)
 {
     return(Matches.Count >= bestOf ? new ParticipantScore(this, bestOf) : null);
 }