Accepted
The initiative system needs to handle ties robustly and be extensible for variant rules (e.g., Speed Factor Initiative).
We will extract the initiative sorting logic into an IInitiativeComparer strategy.
- Interface:
IInitiativeComparer : IComparer<InitiativeRoll> - Standard Implementation:
StandardInitiativeComparersorts by:- Total Roll (Descending)
- Dexterity Score (Descending)
- Random/Deterministic Tie-Breaker (e.g., Creature ID)
- Positive: Decouples sorting logic from the Turn Manager. Allows easy swapping of initiative rules.
- Negative: Adds a small amount of complexity (dependency injection).