Exemple #1
0
 private void btStartTournament_Click(object sender, EventArgs e)
 {
     if (StageLogic.StartTournamnet(_t))
     {
         this.LoadTournament();
     }
 }
Exemple #2
0
        private void MakeWin(bool part1)
        {
            var ctx   = new TourCtrlContext();
            var match = ctx.Match.Find(_match.Id);

            match.WinnerParticipantId = part1 ? match.Participant1Id : match.Participant2Id;

            ctx.SaveChanges();

            if (ctx.Match.Where(x => x.TournamentId == match.TournamentId && x.Stage == match.Stage).All(x => x.WinnerParticipantId.HasValue))
            {
                if (StageLogic.CreateStage(match.TournamentId.Value, match.Stage + 1))
                {
                    this.OnNewStageAdded.Invoke(this, new EventArgs());
                }
            }

            _match.WinnerParticipantId = match.WinnerParticipantId;
            RenderMatch();
        }