As previously mentioned
Published August 16, 2004
Well, dodecahellspawn is compiling again, seemingly without any loss in functionality except for the aesthetic improvements in the solver. Basically, the big change here was that I went from hard coded states to a more extensible object oriented state system. So instead of code like
switch (current_state) { case State::BASAL_STATE: // do stuff break; case State::TRACKBALL_STATE: // do stuff break; // etc.}
I have code like
current_state->do_stuff();
There are pluses and minuses to this system. For example, now all the different event handling code is spread across a bunch of different classes. However, the current state system now allows nested state machines. So the solver state contains a bunch of undo states that will transition to a orient state. And the undo states are themselves state machines that contain orientation and rotation states. This allows me to eliminate some of the unsightly code duplication, and actually reduced the total number of effective states in the system.