public static void Main(string[] args) { //樣板模式-測試 Adventurer saber = new Saber(); Adventurer justice = new Gundam(); MazeTemplate eazyMaze = new EazyMaze(); MazeTemplate hardMaze = new DifficultyMaze(); Console.WriteLine("========樣板模式測試========"); Console.WriteLine("====困難迷宮===="); saber = hardMaze.adventure(saber); Console.WriteLine("====簡單迷宮練功===="); saber = eazyMaze.adventure(saber); //劍士練功後可以進行困難迷宮 Console.WriteLine("====困難迷宮===="); saber = hardMaze.adventure(saber); justice = hardMaze.adventure(justice); }