HomeWildfire Games

Enforce tight coupling of CCmpUnitMotion/CCmpUnitMotionManager

Description

Enforce tight coupling of CCmpUnitMotion/CCmpUnitMotionManager

rP25071 implemented CCmpUnitMotionManager, which handles motion for CCmpUnitMotion (as distinct from ICmpUnitMotion, the interface).
The tight coupling between these two components was awkward at the interface level, leaking underlying implementation details.

This diff makes CmpUnitMotionManager explicitly manage CmpUnitMotion, instead of any implementation of ICmpUnitMotion, and moves files around as requir
ed.
This:

  • Makes it impossible to accidentally try to have the wrong IID_UnitMotion managed by the UnitMotionManager.
  • Allows devirtualising the calls from the manager to UnitMotion itself (and inlining, as they are compiled in the same TU).
  • Cleans up the manager interface - MotionState is now part of CCmpUnitMotionManager.
  • Cleans up ICmpUnitMotion interface - no need to provide a private interface for the manager.

Differential Revision: https://code.wildfiregames.com/D3732