示例#1
0
 public SessionsController(IRepository<Session> sessionRepository,
                          IRepository<Competition> competitionRepository,
                          IDecisionGateway gateway)
 {
     this.sessionRepository = sessionRepository;
     this.competitionRepository = competitionRepository;
     this.gateway = gateway;
 }
示例#2
0
文件: Session.cs 项目: dfreier/duels
        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);
        }