The State pattern is a way to manage objects whose behavior is heavily dependent on their current internal condition or “state.”
Instead of using complex conditional logic directly within the object's methods, the State pattern encapsulates state-specific behavior into separate objects.
The State pattern is an object-oriented implementation of the concept of a Finite State Machine (FSM) or Finite Automaton.
It differs from the Strategy pattern in terms of the intent and dynamics.