public SessionsController(IRepository<Session> sessionRepository, IRepository<Competition> competitionRepository, IDecisionGateway gateway) { this.sessionRepository = sessionRepository; this.competitionRepository = competitionRepository; this.gateway = gateway; }
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); }