protected override Location CreateLocation(string locationTypeString, string locationName) { Location location = null; switch (locationTypeString) { case "forest": location = new Forest(locationName); break; case "mine": location = new Mine(locationName); break; default: return base.CreateLocation(locationTypeString, locationName); } return location; }
protected override Location CreateLocation(string locationTypeString, string locationName) { Location location = null; switch (locationTypeString) { case "town": return(base.CreateLocation(locationTypeString, locationName)); case "mine": location = new Mine(locationName); break; case "forest": location = new Forest(locationName); break; } return(location); }
protected override Location CreateLocation(string locationTypeString, string locationName) { Location location = null; switch (locationTypeString.ToLower()) { case "mine": location = new Mine(locationName); break; case "forest": location = new Forest(locationName); break; default: location = base.CreateLocation(locationTypeString, locationName); break; } return(location); }
protected override Location CreateLocation(string locationTypeString, string locationName) { Location location = null; switch (locationTypeString) { case MineCase: location = new Mine(locationName); break; case ForestCase: location = new Forest(locationName); break; default: location = base.CreateLocation(locationTypeString, locationName); break; } return(location); }
protected override Location CreateLocation(string locationTypeString, string locationName) { Location location = null; switch (locationTypeString) { case "mine": { location = new Mine(locationName); return(location); } case "forest": { location = new Forest(locationName); return(location); } default: { return(base.CreateLocation(locationTypeString, locationName)); } } }