feat(battle-sim): implement battle simulation logic and metrics tracking

- Added WarBattleMetrics interface to track attacker and defender skills during battles.
- Enhanced WarUnit class with method to log activated skills.
- Introduced environment setup for battle simulation, including unit set loading and configuration resolution.
- Developed in-memory and Redis transport layers for handling battle simulation requests and results.
- Created types and interfaces for battle simulation payloads and responses.
- Implemented battle simulation processing logic, including logging and skill tracking.
- Added tests for battle simulation processor to ensure functionality and correctness.
This commit is contained in:
2025-12-30 11:17:28 +00:00
parent 97439f64a9
commit 56e662a7db
20 changed files with 1549 additions and 7 deletions
+13
View File
@@ -0,0 +1,13 @@
export interface BattleSimQueueKeys {
queueKey: string;
resultKeyPrefix: string;
notifyKeyPrefix: string;
}
export const buildBattleSimQueueKeys = (
profileName: string
): BattleSimQueueKeys => ({
queueKey: `sammo:${profileName}:battle-sim:queue`,
resultKeyPrefix: `sammo:${profileName}:battle-sim:result:`,
notifyKeyPrefix: `sammo:${profileName}:battle-sim:notify:`,
});