private Report loadReport(string reportTitle) { if (reportTitle.StartsWith("LEAGUE STANDINGS")) { return(new LeagueStandingsReport(reportTitle, Program.LEAGUES[0].Length > 0)); } if (reportTitle.StartsWith("LEAGUE GRAND TOTALS (primary report) FOR")) { return(new LeagueGrandTotalsReport(reportTitle)); } else if (reportTitle.StartsWith("INJURY/MINOR LEAGUE REPORT FOR")) { return(new LineScoreAndMinorsReport(reportTitle)); } else if (reportTitle.StartsWith("AWARDS VOTING FOR")) { return(new NewspaperStyleReport(reportTitle)); } else if (reportTitle.StartsWith("RECORD BOOK FOR FOR")) { return(new RecordBookReport(reportTitle)); } else if (reportTitle.StartsWith("Comparison Report")) { if (comparisonReport == null) { comparisonReport = new ComparisonReport(reportTitle, Config.config); } return(comparisonReport); } else if (reportTitle.StartsWith("Primary Player Statistics")) { if (primaryStatsReport == null) { primaryStatsReport = new PrimaryStatsReport(reportTitle, Config.config); } return(primaryStatsReport); } else { return(new Report(reportTitle)); } }
public void initialize(ISOMReportFile teamReportFile) { Console.WriteLine(" Building Comparison..."); Console.WriteLine(" Showing Moral=" + Config.SHOW_MORAL + ", Showing Warnings=" + Config.SHOW_WARNING); teamPrimaryStatsReport = (PrimaryStatsReport)teamReportFile.FindReport("LEAGUE", "Primary Player Statistics For"); teamPrimaryStatsReport.processReport(Program.LEAGUES[0].Length); List <Player> replayPlayers = teamPrimaryStatsReport.getPlayers(); teamComparisonReport = (ComparisonReport)teamReportFile.FindReport("LEAGUE", "Comparison Report"); if (teamComparisonReport == null) { System.Console.WriteLine("Are you sure you selected 'ALL REPORTS' for the Team Reports?"); throw new Exception("Unable to find Comparison Report in the Team Report File"); } teamComparisonReport.setPlayerActualData(replayPlayers); teamComparisonReport.processReport(Program.LEAGUES[0].Length); }