Browse Source

Add documentation comments for EntityCache and EXPECTED_MAX_UNITS

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 4 days ago
parent
commit
f700590ae4
2 changed files with 3 additions and 0 deletions
  1. 2 0
      app/core/game_engine.h
  2. 1 0
      app/core/minimap_manager.cpp

+ 2 - 0
app/core/game_engine.h

@@ -83,6 +83,8 @@ class AudioSystemProxy;
 
 class QQuickWindow;
 
+// Cache for tracking entity counts to avoid frequent queries
+// Used by GameEngine and passed to AmbientStateManager for state transitions
 struct EntityCache {
   int player_troop_count = 0;
   bool player_barracks_alive = false;

+ 1 - 0
app/core/minimap_manager.cpp

@@ -183,6 +183,7 @@ void MinimapManager::update_units(
 
   std::vector<Game::Map::Minimap::UnitMarker> markers;
   // Reserve space for typical unit count to avoid reallocations
+  // Based on common game scenarios with up to ~100 units per side
   constexpr size_t EXPECTED_MAX_UNITS = 128;
   markers.reserve(EXPECTED_MAX_UNITS);