Using C#, I'm working on a project in which several objects need to interact with one another while all side by side in the main.
My current issue is as follows: I have three objects inside of my Main class, we'll call them Player
, Enemy
and BattleSystem
.
Without tightly coupling the objects by using ref, I'd like to be able to access the functions in the Player
and Enemy
objects while inside of the BattleSystem
object, mainly to access the getters and some functions like DealDamage
etc, I'm sure you get the idea.
What would you chaps suggest to do in a situation like this? Would going the Ref route be the only way or is there some way to make the objects visible project wide or some form of mailing system I can create to send messages back and forth between objects?