Ideally how many parameters should an object reference pass through to obtain that reference in a different class before it becomes "bad design or unreadable"?
I'm coding my game in Java. I only pass 2 parameters so I am not sure if I am safe or I need to refactor it.
I'm writing a dialogue system where I need the object reference of the main character. Problem is that reference is in the Game class. I need it in the DialogueSystem class. But it needs to go through the parameters of the NPC update method and then pass through the DialogueSystem update method.
The reason I need it in the DialogueSystem is because I need to make sure the main character does not move when it is interacting with the npcs by checking its ActionState (IDLE,RUNNING,etc).
Each NPC has a DialogueSystem object tied to it.