PedrelliLuca / ScalarField

A TopDown RPG Game, where magic works by interacting with the environment.
4 stars 0 forks source link

Make an Interactor Component #35

Closed PedrelliLuca closed 1 year ago

PedrelliLuca commented 1 year ago

Why?

At the moment, all the code that performs focus and interaction checks is stored inside AScalarFieldPlayerController, which implements the IInteractorInterface. However, making controllers manage system-specific instructions (like focus and interactions, which are interaction system-specific) causes them to become very huge classes that have too many responsibilities.

What?

Make a new UInteractorPlayerComponent that inherits from UActorComponent and implements IInteractorInterface. Then, move all focus and interaction-related code in there from AScalarFieldPlayerController.