Example #1
0
        /// <summary>
        /// 构造函数.
        /// </summary>
        /// <param name="owner"></param>
        public Account(string owner)
        {
            this._owner = owner;

            // 新账户默认的状态为: 'Silver'
            this._state = new SilverState(0.0, this);
        }
Example #2
0
 // Overloaded constructors
 public SilverState(State state)
     : this(state.Balance, state.Account)
 {
 }
Example #3
0
 // Overloaded constructors
 public GoldState(State state)
     : this(state.Balance, state.Account)
 {
 }
Example #4
0
        /// <summary>
        /// 构造函数.
        /// </summary>
        /// <param name="state"></param>
        public RedState(State state)
        {
            // 设置 账户余额 与 账户.
            this.balance = state.Balance;
            this.account = state.Account;

            // 初始化 本状态的基本参数.
            Initialize();
        }