Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/game/BattleSimulatorPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
}, [selectedUnit, selectedTeam, spawnQuantity]);

const handleFight = useCallback(() => {
console.log('[BattleSimulator] handleFight called');

Check warning on line 213 in src/components/game/BattleSimulatorPanel.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement. Only these console methods are allowed: warn, error
const bridge = getWorkerBridge();
const worldAdapter = RenderStateWorldAdapter.getInstance();

Expand All @@ -223,16 +224,19 @@
return;
}

console.log('[BattleSimulator] Registering AI for both players');

Check warning on line 227 in src/components/game/BattleSimulatorPanel.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement. Only these console methods are allowed: warn, error
// Register both players as AI-controlled so the AI takes over and fights
const player1Faction = playerSlots[0]?.faction ?? 'dominion';
const player2Faction = playerSlots[1]?.faction ?? 'dominion';
bridge.registerAI('player1', player1Faction, 'medium');
bridge.registerAI('player2', player2Faction, 'medium');

const currentTick = bridge.currentTick;
console.log('[BattleSimulator] Current tick:', currentTick);

Check warning on line 235 in src/components/game/BattleSimulatorPanel.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement. Only these console methods are allowed: warn, error

// Get all units from render state adapter
const entities = worldAdapter.getEntitiesWith('Unit', 'Selectable', 'Transform', 'Health');
console.log('[BattleSimulator] Found entities:', entities.length);

Check warning on line 239 in src/components/game/BattleSimulatorPanel.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement. Only these console methods are allowed: warn, error

for (const entity of entities) {
const selectable = entity.get<{ playerId: string }>('Selectable');
Expand Down Expand Up @@ -281,9 +285,11 @@
}
}

console.log('[BattleSimulator] Calling bridge.resume()');

Check warning on line 288 in src/components/game/BattleSimulatorPanel.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement. Only these console methods are allowed: warn, error
bridge.resume();
setIsPaused(false);
setSelectedUnit(null);
console.log('[BattleSimulator] handleFight completed');

Check warning on line 292 in src/components/game/BattleSimulatorPanel.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement. Only these console methods are allowed: warn, error
}, [playerSlots]);

const handlePauseToggle = useCallback(() => {
Expand Down
Loading