MDonnellyDev/TacticsAlpha — Issue #14: Refactoring
Author: StrixVaria
Created: 2011-10-19 20:37:34+00:00
State: open

I'm sure the first of many issues with this title, the idea of this one is to make the Game class more robust.

The InputHelper interface should be updated to have 2 methods. The update(boolean) method will update the internal state of the InputHelper so that it remembers what state it should have for this frame and can be referenced repeatedly. The state() method will simply return the state for the current frame. This will allow any method within the Game to know the state of a given key this frame.

This will allow the update method of the Game itself to serve as a switch based on game state to delegate down to the appropriate specific method to handle the task at hand. This should hopefully make the update code of Game much cleaner overall. The game state should be very specific rather than generic. Rather than trying to handle every kind of menu in the same method, we could have different states depending on what menu is showing. There really shouldn't be a huge variety of menus anyway.