public static void Main1(string[] args) { Context context = new Context(); //创建环境 State a = new ConcreteStateA(); a.Handle(context); context.Handle(); //处理请求 }
private void Start() { concreteStateA.Handle(context); concreteStateB.Handle(context); }
public static void Main1(string[] args) { Context context = new Context(); //创建环境 State a = new ConcreteStateA(); a.Handle(context); context.Handle(); //处理请求 }
private void Start() { concreteStateA.Handle(context); concreteStateB.Handle(context); }