//• void Open(int id, string type, int length, string route, int prizePool) public void Open(int id, string type, int length, string route, int prizePool) { //open {id} {type} {length} {route} {prizePool} //OPENS a race of the given type, with the given id, and stats. //The race type will be either “Casual”, “Drag” or “Drift”. var raceFactory = new RaceFactory(); var race = raceFactory.MakeRace(type, length, route, prizePool); if (race != null) { this.races.Add(id, race); } else { throw new ArgumentException("Open: race is null"); } }
public void Open(int id, string type, int length, string route, int prizePool, int extraParameter) { var race = RaceFactory.MakeRace(id, type, length, route, prizePool, extraParameter); races.Add(id, race); }