コード例 #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("========備忘錄模式-測試========");

            Console.WriteLine("");
            GameRole boss = new GameRole();

            boss.display();


            Console.WriteLine("使用複雜的密技降低Boss攻擊力");
            boss.ATK = 60;

            //趕快存檔
            RoleStateCateTaker rsc = new RoleStateCateTaker();

            rsc.setSave(boss.save());
            boss.display();

            //開打
            boss.fight();
            boss.display();

            //隊伍太廢,倒了一半,快速讀取剛才的存檔
            boss.load(rsc.getSave());
            Console.WriteLine("重新讀檔!");
            boss.display();
        }