Chapter 10. The State Design Pattern