I’m pretty new to all of this, please bear with me:
For most cases in my game, I register and send specific classes via kryonet which contain specific values (Attack.class has caster, target, dmg).
But for a number of use cases, all info that’s needed could either be the class itself (StartFight.class) or it could be a String “Start Fight”.
What are the pros and cons for either approach? I’d either have a long list of
if (object instanceof SomeSingleUseObjectWithNoVariables)
else if (object instanceof SomeOTHERSingleUseObjectWithNoVariables)
if (object.equals(“Start Fight”))
else if (object.equals(“Exit Game”))
and so on. Is there an even better approach?