State pattern

The state pattern