Ok so I have a physics heavy simulation that's being chiefly run in my main level class.
I then have various characters that inherit from a general 'unit' class (it's similar to a top down RTS). I'm struggling to see which approach is best/ will be best for future efficiency when it comes to having these units interact with the physics of the world.
1) Pass all of the relevant data into each units Update function and allow them to manipulate it from there.
2) Have the units update function return an integer or something that corresponds to a particular action which is then carred out in the main game class.
So one is helpful in that it allows the entirety of the unit's capability to be contained within the class file. The other is helpful in that you don't need to pass a huge selection of variables to the update each time and all of the physics can be handled from within the main class.
Thoughts and suggestions are welcome. Is there a clear benefit to one over the other here that I'm missing or is it just a matter of preference.
Thanks in advance.