• Advertisement
Sign in to follow this  
  • entries
    195
  • comments
    198
  • views
    104077

As previously mentioned

Sign in to follow this  

107 views

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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement