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

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

            memberA.getType();
            memberB.getType();
        }
示例#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();
        }