public IScore CreateScore( string scoreType) { IScore score = null; switch (scoreType) { case "P": score = new TdPass(); break; case "R": score = new TdRun(); break; case "3": score = new FieldGoal(); break; case "1": score = new PointAfter(); break; case "F": score = new FumbleReturn(); break; case "I": score = new InterceptReturn(); break; case "K": score = new KickOffReturn(); break; case "T": score = new PuntReturn(); break; case "S": score = new Safety(); break; case "2": score = new TwoPointConversionPass(); break; case "N": score = new TwoPointConversionRun(); break; default: RosterLib.Utility.Announce( string.Format("A score of type {0} cannot be found", scoreType ) ); break; } if (score != null) score.ScoreType = scoreType; return score; }
public IScore CreateScore(string scoreType) { IScore score = null; switch (scoreType) { case "P": score = new TdPass(); break; case "R": score = new TdRun(); break; case "3": score = new FieldGoal(); break; case "1": score = new PointAfter(); break; case "F": score = new FumbleReturn(); break; case "I": score = new InterceptReturn(); break; case "K": score = new KickOffReturn(); break; case "T": score = new PuntReturn(); break; case "S": score = new Safety(); break; case "2": score = new TwoPointConversionPass(); break; case "N": score = new TwoPointConversionRun(); break; default: RosterLib.Utility.Announce(string.Format("A score of type {0} cannot be found", scoreType)); break; } if (score != null) { score.ScoreType = scoreType; } return(score); }