There is no direct correspondence between a state machine and code, you could use any programming algorithm to implement it. For example, you could use an enumeration type with an enumeration literal for each possible state and use it in your implementation class to represent to current state of your instance.
But you could also use other values like "if the user has an empty command list he is in the prospect state".