protected override FootballTeam CreateTeam(OffensiveType type) { FootballTeam result; var nflCriteriaAbstractFactory = new NflTeamCreationCriteriaAbstractFactory(type); switch (type) { case OffensiveType.Balanced: result = new BalancedFootballTeam(nflCriteriaAbstractFactory); break; case OffensiveType.PassHappy: result = new PassHappyFootballTeam(nflCriteriaAbstractFactory); break; case OffensiveType.BallControl: result = new BallControlFootballTeam(nflCriteriaAbstractFactory); break; default: throw new ArgumentOutOfRangeException("type"); } return(result); }
public FootballTeam Create(OffensiveType type) { FootballTeam result; //var name = string.Format("[{0} NFL Team]", type); //var coach = string.Format("{0} {1}", type, "NFL Coach"); //const int nflRosterSize = 53; switch (type) { case OffensiveType.Balanced: result = new NflBalancedFootballTeam(/*name, coach, nflRosterSize*/); break; case OffensiveType.PassHappy: result = new NflPassHappyFootballTeam(/*name, coach, nflRosterSize*/); break; case OffensiveType.BallControl: result = new NflBallControlFootballTeam(/*name, coach, nflRosterSize*/); break; default: throw new ArgumentOutOfRangeException("type"); } return(result); }
public void Run(OffensiveType type) { FootballTeam team; team = CreateTeam(type); RunSim(team); }
public Offensive(int amount, int amountOverTime, int amountCurRounds, int amountMaxRounds, OffensiveType offenseType) { Amount = amount; AmountOverTime = amountOverTime; AmountCurRounds = amountCurRounds; AmountMaxRounds = amountMaxRounds; OffensiveGroup = offenseType; }
public NflTeamCreationCriteriaAbstractFactory(OffensiveType type) { HeadCoach = string.Format("{0} {1}", type, "NFL Coach"); Name = string.Format("[{0} NFL Team]", type); }
protected abstract FootballTeam CreateTeam(OffensiveType type);
public void Run(OffensiveType type) { var team = _teamFactory.Create(type); RunSim(team); }
public CollegeTeamCreationCriteriaAbstractFactory(OffensiveType type) { HeadCoach = string.Format("{0} {1}", type, "College Coach"); Name = string.Format("[{0} College Team]", type); }