public static string Describe(TravelMethod travelMethod) { if (travelMethod == TravelMethod.Walking) { return("You're traveling to your destination by walking."); } return("You're traveling to your destination on horseback."); }
public IVehicle CreateVehicle(TravelMethod howToTravel) { switch (howToTravel) { case TravelMethod.Drive: return(new Car()); case TravelMethod.Fly: return(new Plane()); default: throw new NotSupportedException("Factory cannot create vehicle to travel by method: " + howToTravel); } }
public static string Describe(Character character, Destination destination, TravelMethod travelMethod) { throw new NotImplementedException("Please implement the (static) GameMaster.Describe(Character, Destination, TravelMethod) method"); }
public static string Describe(TravelMethod travelMethod) { throw new NotImplementedException("Please implement the (static) GameMaster.Describe(TravelMethod) method"); }
public static string Describe(TravelMethod travelMethod) => travelMethod switch {
public static string Describe(Character character, Destination destination, TravelMethod travelMethod = TravelMethod.Walking) { return($"{Describe(character)} {Describe(travelMethod)} {Describe(destination)}"); }