5.5.4 How to Use the State Pattern