I’m making a framework for a combat game and the way I’m aproaching it is storing all the active moves as OOP objects in a table on the server under a numeric global index, so that they can be accessed later on if needed.
However there might be moves that need to listen to some events. Like for example if one player is leaving game, all the on going moves fired by that player should be finalized when that happens. My question is, is it better to have a single global listener for that event, which would then loop through all the objects that need to be finalized (they would be on a separate table so the game wouldn’t loop through all the table), or would it be better to have an event per move? Which one consumes less memory? Which one has a fastest response time? Which one is more efficient?