State Pattern

The State Pattern is a behavioral design pattern that allows an object to alter its behavior when its internal state changes. This pattern makes state transitions explicit and simplifies the management of complex state-dependent logic in software design.