状态模式
The State Pattern is a behavioral design pattern that allows an object to alter(改变) its behavior when its internal(内部) state changes. This pattern is used to encapsulate(封装) varying(变化) behavior for the same routine(例行程序) based on an object's state object. It's essentially(本质上) a way to model state transitions(过渡) in an object-oriented(面向对象) way.