There needs to be a way for Module to access their actors position. Consider some different approaches, and implement the best suited one.
Some options:
- Public method in Actor that gets the position from the World it's contained in.
- Making the _world field public.
Considering that I would like to change World into not having positions stored, and instead have a subclass for positioning, the following are the drawbacks of each approach:
- Public method in Actor that gets the position from the World it's contained in: Having tight coupling wouldn't work, as not every Actor would be in a world with positions for its actors.
- Making the _world field public: I believe this would only cause issues within a Module if the referenced world doesn't cast to a world subclass with positioning.
Both of these approaches could be fixed by making a subclass of Actor, and implementing one of the suggested approaches. Might be an idea to also create a subclass of Module in this case.
Reactions are currently unavailable
There needs to be a way for Module to access their actors position. Consider some different approaches, and implement the best suited one.
Some options:
Considering that I would like to change World into not having positions stored, and instead have a subclass for positioning, the following are the drawbacks of each approach:
Both of these approaches could be fixed by making a subclass of Actor, and implementing one of the suggested approaches. Might be an idea to also create a subclass of Module in this case.