コード例 #1
0
        private static void Main(string[] args)
        {
            Console.WriteLine("-------------俱乐部会员服务的状态模式实现--------------");
            ClubAccount account = new ClubAccount("张三");

            account.ClubService();

            account.Deposit(100);
            account.ClubService();

            account.Deposit(300);
            account.ClubService();

            account.Deposit(1000);
            account.ClubService();

            account.Cost(100);
            account.ClubService();

            account.Cost(1000);
            account.ClubService();

            account.Cost(300);
            account.ClubService();

            Console.ReadLine();
        }
コード例 #2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("-------------俱乐部会员服务的状态模式实现--------------");
            ClubAccount account = new ClubAccount("张三");
            account.ClubService();

            account.Deposit(100);
            account.ClubService();

            account.Deposit(300);
            account.ClubService();

            account.Deposit(1000);
            account.ClubService();

            account.Cost(100);
            account.ClubService();

            account.Cost(1000);
            account.ClubService();

            account.Cost(300);
            account.ClubService();

            Console.ReadLine();
        }
コード例 #3
0
 public VIPState(double balance, ClubAccount account)
 {
     Balance = balance;
     Account = account;
     Initialize();
 }
コード例 #4
0
 public VisitorState(double balance, ClubAccount account)
 {
     Balance = balance;
     Account = account;
     Initialize();
 }