Open ted537 opened 2 years ago
Agents need to access physics. Physics needs to access World. World needs to access Agents.
These dependencies must be altered if we wish to resolve the circular imports and eliminate the WorldCollider interface.
One possible solution would be to separate the World struct from the methods that operate on the World struct. The package containing the World struct would be inherited everywhere and the package containing the World methods would only be imported by high-level packages like game/
.
The WorldCollider interface was added because physics code needs to be able to check for collisions on the World. We cannot pass a World to the physics engine due to a circular import.