MoveTo and StartMoveAction in the same class

I’m a bit skeptical on the approach where both MoveTo and StartMoveAction are in the Mover class. They are fundamentally quite different I would say. MoveTo is only meant to be called by other actions (at the moment, Fighter’s attack behavior), while StartMoveAction should be for all other external clients (for example, controllers).
I think logically we’re merging two classes into one. Logically there’s a core Movement functionality, the MoveTo method, which Fighter depends on. And then there’s the action Move, which also depends on the core MoveTo functionality. I’m think the action level move (StartMoveAction) and the underlying move (MoveTo) should probably be separated into different classes. We can identify this problem easier if we actually try to write documentation for these two methods: we’ll have to clarify which caller is supposed to call which method.
Fighter depends on MoveTo. It shouldn’t depend on StartMoveAction. Similarly, the AIController shouldn’t have access to MoveTo, and should only use StartMoveAction.

This isn’t really that big of a deal at the end of the day, but I think this is kind of a bad smell, albeit inconsequential

Privacy & Terms