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); }
private void GetResultsFromData(Session session) { results = StatisticManager.GetResultsFromDatabase(session); Statistic = StatisticManager.GetChampionships(results, PointSystem, DoublePoints); if (DataLoadedFromDatabase != null) { DataLoadedFromDatabase(this, new EventArgs()); } }
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); } }
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); }
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); }
void StatisticManager_ResultsUpdated(object sender, ResultsUpdatedEventArgs e) { ChampionshipStatistic newStatistic = StatisticManager.GetChampionships(e.results, PointSystem, DoublePoints); RunResultsComparison(e.results, e.session, Statistic, newStatistic); }