Now, look at line 6 of the
StateManager class in the following screenshot. We have a big problem right off the bat:
activeState variable needs to be able to store all of the State types. Right now it can only store a reference to a
BeginState type of object. This looks like a huge problem! What about the classes
LostState? What if we had 50 different States that needed to be referenced in
The following diagram is our dilemma:
Let's look ...