public void CommitMatch() // MatchSubsystem.java / commitMatch
        {
            MatchPlayedThisEvent m = this;

            m.AddCommitHistory(new Commit(m.NewCommitInstant, TCommitType.COMMIT));
            if (m.StartTime <= DateTimeAsInteger.NegativeOne)
            {
                m.StartTime = DateTimeOffset.UtcNow;
            }

            if (m.MatchType == TMatchType.TEST)
            {
                m.MatchState = TMatchState.Committed;
            }
            else if (m.MatchType == TMatchType.QUALS)
            {
                m.CommitMatchCore();
                m.MatchState = TMatchState.Committed;

                Database.ThisEvent.CalculateAndSetRankings();
                Database.LeagueSubsystem.CalculateAndSetAllLeagueRankings(); // more a formality/mirroring ScoreKeeper, as this makes no persistent updates
                Database.LeagueSubsystem.CreateExportTemp();
            }
            else // if (m.MatchType == TMatchType.ELIMS)
            {
                throw new NotImplementedException($"{GetType().Name}.{nameof(CommitMatch)}: {m.MatchType}");
            }
        }
        //----------------------------------------------------------------------------------------
        // Saving
        //----------------------------------------------------------------------------------------

        public void SaveNonCommitMatchHistory(TCommitType commitType) // see SQLiteMatchDAO/saveNonCommitMatchHistory
        {
            MatchPlayedThisEvent m = this;

            m.AddCommitHistory(new Commit(m.NewCommitInstant, commitType));
            DateTimeOffset commitTime = m.CommitHistoryLatest.Ts;

            // BLOCK
            {
                var psHistory = Database.Tables.QualsCommitHistory.NewRow();
                psHistory.MatchNumber.Value   = m.MatchNumber;
                psHistory.Ts.Value            = commitTime;
                psHistory.Start.Value         = m.StartTime;
                psHistory.Randomization.Value = (int)m.Randomization;
                psHistory.CommitType.Value    = (int?)commitType;
                psHistory.Insert();
            }

            foreach (var s in new [] { m.RedScores, m.BlueScores })
            {
                int alliance = s == m.RedScores ? 0 : 1;

                // BLOCK
                {
                    var psScoresHistory = Database.Tables.QualsScoresHistory.NewRow();
                    psScoresHistory.MatchNumber.Value = MatchNumber;
                    psScoresHistory.Ts.Value          = commitTime;
                    psScoresHistory.Alliance.Value    = alliance;
                    s.Save(psScoresHistory);
                    psScoresHistory.Insert();
                }

                // BLOCK
                {
                    var psGameHistory = Database.Tables.QualsGameSpecificHistory.NewRow();
                    psGameHistory.MatchNumber.Value = MatchNumber;
                    psGameHistory.Ts.Value          = commitTime;
                    psGameHistory.Alliance.Value    = alliance;
                    s.Save(psGameHistory);
                    psGameHistory.Insert();
                }
            }
        }