Ejemplo n.º 1
0
 public Acount(string owin, double blance)
 {
     this.blance = blance;
     this.owner  = owin;
     this.state  = new NormalState(this);//设置初始状态
     Console.WriteLine($"开启账户余额{this.blance}");
 }
Ejemplo n.º 2
0
 public NormalState(AcountState state)
 {
     this.Acc = state.Acc;
 }
Ejemplo n.º 3
0
 public OverdraftState(AcountState state)
 {
     this.Acc = state.Acc;
 }
Ejemplo n.º 4
0
 public RestrictedState(AcountState state)
 {
     this.Acc = state.Acc;
 }