Ejemplo n.º 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));
 }
Ejemplo n.º 2
0
 internal ParticipantScore(Participant participant, BestOf bestOf) : base(participant.Matches.OrderByDescending(match => match.Score).Take(bestOf).Average(match => match.Score.ToDecimal()))
 {
 }
Ejemplo n.º 3
0
 public Score?ComputeScore(BestOf bestOf)
 {
     return(Matches.Count >= bestOf ? new ParticipantScore(this, bestOf) : null);
 }