Is putting namespace Control on CombatTarget causing a circular dependency?

Hello everyone!

So quick question here, I noticed in lecture 3 of the last section of the RPG course(Generic Raycastable components) that we are adding the IRaycastable interface on the CombatTarget component, creating a dependency on the Control namespace. However, the control namespace already depends on the Combat namespace since we have references to Fighter on the Player and AI controllers.

Does this count as a circular dependency?

Thanks!

It does, though it’s an indirect association… PlayerController no longer relies on Combat (though AIController does, but IRaycastables don’t care about AIControllers.

That being said, it is reasonable to try to refactor this cross dependency away… The key would be moving the IRaycastable and the CursorType to RPG.Core, and instead of passing a PlayerController to IRaycastable to simply pass a GameObject.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms