Exemplo n.º 1
0
 public SessionsController(IRepository<Session> sessionRepository,
                          IRepository<Competition> competitionRepository,
                          IDecisionGateway gateway)
 {
     this.sessionRepository = sessionRepository;
     this.competitionRepository = competitionRepository;
     this.gateway = gateway;
 }
Exemplo n.º 2
0
        public void RegisterDecision(Decision decision, IDecisionGateway gateway)
        {
            if (this.IsClosed) return;

            var duel = decision.Duel;

            AssertScheduleContainsDuel(duel);
            AssertDecisionIsNotRegisteredYet(duel);

            this.Outcomes.Add(new Outcome(decision));
            this.Schedule.Remove(duel);

            gateway.Transfer(this.CompetitionId, decision);
        }