Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    195
  • comments
    198
  • views
    104193

As previously mentioned

Sign in to follow this  
SiCrane

114 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!