Tag Info

Hot answers tagged

2

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 ...


2

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 ...


2

Because of type erasure you lose the compile time type information of generics when transmitting data over network. If you need it on the receiving side again, you have to put the type information back yourself somehow. It's impossible to say how you should do this, but typically it involves either enums or class names and some type casting.



Only top voted, non community-wiki answers of a minimum length are eligible