public void initialize(String fileLocation) { BalanceAtBats = new List <Dictionary <int, int> >(); // Load Stored data from database file StoredLineups = LineupPersistence.loadDatabase(); TeamReportFile = new SOMTeamReportFile(fileLocation, StoredLineups, new Config()); TeamReportFile.parse(); CompleteListOfTeams = TeamReportFile.getTeams(); TeamLineupData = TeamInformation.loadDatabase(); }
public static IUsageCalculator getCalculator(CalculatorType type, SOMTeamReportFile teamReportFile, Team targetTeam) { if (type == CalculatorType.SP_BASIC) { return(new SPOnly_Straight_Calculator(teamReportFile, targetTeam)); } else if (type == CalculatorType.SP_SCHEDULE) { return(new SPOnly_ScheduleWeighted_Calculator(teamReportFile, targetTeam)); } else if (type == CalculatorType.ALL_PITCHERS_AND_SCHEDULE) { return(new AllPitchers_ScheduleWeighted_Calculator(teamReportFile, targetTeam)); } throw new Exception("Unimplemented Calculator Type Requested"); }
public SPOnly_Straight_Calculator(SOMTeamReportFile teamReportFile, Team targetTeam) { this.teamReportFile = teamReportFile; this.targetTeam = targetTeam; }
public SPOnly_ScheduleWeighted_Calculator(SOMTeamReportFile teamReportFile, Team targetTeam) { this.teamReportFile = teamReportFile; this.targetTeam = targetTeam; }