static void Main(string[] args)
        {
            Adventurer memberA = TrainingCamp.trainAdventurer("archer");
            Adventurer memberB = TrainingCamp.trainAdventurer("warrior");

            Console.ReadLine();
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            Adventurer memberA = TrainingCamp.trainAdventurer("archer");
            Adventurer memberB = TrainingCamp.trainAdventurer("warrior");

            memberA.getType();
            memberB.getType();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("簡單工廠模式");
            // 訓練一個弓箭手
            IAdventurer archer = TrainingCamp.TrainAdventurer(AdventurerType.Archer);

            archer.ShowType();

            // 訓練一個鬥士
            IAdventurer warrior = TrainingCamp.TrainAdventurer(AdventurerType.Warrior);

            warrior.ShowType();
        }