Maescool/Catacomb-Snatch — Issue #716: Refactoring MojamComponent.java
Author: GreenLightning
Created: 2012-03-03 19:42:35+00:00
State: open

I would suggest refactoring MojamComponent.java and splitting it up in:
* gameplay.Gamestate.java
* gameplay.Singleplayer.java
* gameplay.Multiplayer.java
* MojamComponent.java

In MojamComponent you could have a Gamestate object and in the tick method just call the gamestate's tick method. In the render method you'd have to check whether there's a menu open and render this and otherwise render the gamestate.

I think this would improve the design a lot and it would remove all these (isMultiplayer() && level != null) checks from the tick and render methods in MojamComponent!

I just wanted to ask what you think of this and if it is possible to do such a refactoring because of the merging conflicts that will arise!