コード例 #1
0
        public void TestDatabase()
        {
            var Data         = new Data();
            var results      = DataSources.DataConnections.DriverResultsTableUpdater.GetResultsFromDatabase(Session.Race, Data.NumberOfDrivers, Data.NumberOfTracks, StratSim.Properties.Settings.Default.CurrentYear, Driver.GetDriverIndexDictionary());
            var championship = StatisticManager.GetChampionships(results, PointScoringSystem.Post2009, true);

            Assert.AreEqual(384, ((ChampionshipDataElement)championship.DriverStats[0]).Points);
        }
コード例 #2
0
 private void GetResultsFromData(Session session)
 {
     results   = StatisticManager.GetResultsFromDatabase(session);
     Statistic = StatisticManager.GetChampionships(results, PointSystem, DoublePoints);
     if (DataLoadedFromDatabase != null)
     {
         DataLoadedFromDatabase(this, new EventArgs());
     }
 }
コード例 #3
0
        void ChampionshipData_PointSystemChanged(object sender, EventArgs e)
        {
            ChampionshipStatistic newStatistic = StatisticManager.GetChampionships(results, PointSystem, DoublePoints);

            RunResultsComparison(results, session, Statistic, newStatistic);
            if (ChampionshipsModified != null)
            {
                ChampionshipsModified(this, newStatistic);
            }
        }
コード例 #4
0
        internal int[] GetTeamData()
        {
            int[] teamChampionship = new int[Data.NumberOfDrivers / 2];

            ChampionshipStatistic statistic = StatisticManager.GetChampionships(results, pointSystem, doublePoints);

            for (int teamIndex = 0; teamIndex < Data.NumberOfDrivers / 2; teamIndex++)
            {
                teamChampionship[teamIndex] = ((ChampionshipDataElement)statistic.TeamStats[teamIndex]).Points;
            }

            return(teamChampionship);
        }
コード例 #5
0
        internal int[] GetDriverData()
        {
            int[] driverChampionship = new int[Data.NumberOfDrivers];

            ChampionshipStatistic statistic = StatisticManager.GetChampionships(results, pointSystem, doublePoints);

            for (int driverIndex = 0; driverIndex < Data.NumberOfDrivers; driverIndex++)
            {
                driverChampionship[driverIndex] = ((ChampionshipDataElement)statistic.DriverStats[driverIndex]).Points;
            }

            return(driverChampionship);
        }
コード例 #6
0
        void StatisticManager_ResultsUpdated(object sender, ResultsUpdatedEventArgs e)
        {
            ChampionshipStatistic newStatistic = StatisticManager.GetChampionships(e.results, PointSystem, DoublePoints);

            RunResultsComparison(e.results, e.session, Statistic, newStatistic);
        }