Tag Info

New answers tagged

0

I found it a little bit difficult to follow the entire thread of your question. However at the most basic level, in a simple FSM you could either just query the current state of your StateMachine (i.e. assuming its a singleton manager class etc : StateMachine.Instance.GetState ) and then do the necessary long-winded if or switch statement logic depending on ...


3

A slight variant to jzx's implementation would be to use an update method similar to how you did your draw. It's not uncommon in architectural design to have some context object that often holds a plethora of state information. public interface GameEntity { void update(GameContext ctx); void draw(RenderContext ctx); } Therefore, inside a ...


3

As you've noticed, there are pros and cons to each architecture scheme. Each pattern has its own implications for how objects will interact, and when. First, I'd recommend a quick refresher on SOLID design. Now, what we strive to accomplish with good architecture is enough abstraction that we aren't hampered by the system when we want to add a feature. If ...



Top 50 recent answers are included