static void Main(string[] args) { Adventurer memberA = TrainingCamp.trainAdventurer("archer"); Adventurer memberB = TrainingCamp.trainAdventurer("warrior"); Console.ReadLine(); }
public static void Main(string[] args) { Adventurer memberA = TrainingCamp.trainAdventurer("archer"); Adventurer memberB = TrainingCamp.trainAdventurer("warrior"); memberA.getType(); memberB.getType(); }
static void Main(string[] args) { Console.WriteLine("簡單工廠模式"); // 訓練一個弓箭手 IAdventurer archer = TrainingCamp.TrainAdventurer(AdventurerType.Archer); archer.ShowType(); // 訓練一個鬥士 IAdventurer warrior = TrainingCamp.TrainAdventurer(AdventurerType.Warrior); warrior.ShowType(); }