Wednesday, April 9, 2014

Time to Refactor

I am rewriting my code for the planning level. Now that I have a better understanding of what exactly it needs to do, and how it integrates with the other parts of the project, a number of flaws with my first version have become apparent.

The undo / redo system was becoming overly complicated due to the way that I abstracted the operations that go into the stack. Rather than having a different object to represent each type of operation, I now have one object that can be initialized to represent any operation. I am also getting rid of the idea that single and group operations need to be handled separately. To accomodate group and single operations being performed by the same function, the operation object can now contain a list of instructions. This means that instead of pushing move, move, move, group(3) onto the undo stack to represent moving three selected objects only one operation object needs to be pushed.

User input will be mapped to the keyboard and mouse differently, and I will be trying to avoid some graphical bugs that came up the first time around.

No comments:

Post a Comment