示例#1
0
 public static ICommand Create(commandList commandName, TrainingGuy trainingGuy)
 {
     if (commandName == commandList.SwitchUp)
     {
         return(new SwitchUpCommand(trainingGuy));
     }
     else if (commandName == commandList.SwitchDown)
     {
         return(new SwitchDownCommand(trainingGuy));
     }
     else
     {
         Console.WriteLine("Invalid command");
         return(null);
     }
 }
示例#2
0
 ExecuteNextCommand(commandList, commandListPosition);