Browse Source

Remove debug statements from system, map, unit, and main files

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 2 months ago
parent
commit
3b1f43512a

+ 0 - 14
game/map/map_transformer.cpp

@@ -78,8 +78,6 @@ MapTransformer::applyToWorld(const MapDefinition &def,
                                   : "AI Player " + std::to_string(playerId);
 
       ownerRegistry.registerOwnerWithId(playerId, ownerType, ownerName);
-      qDebug() << "[MapTransformer] Registered player" << playerId << "as"
-               << (isLocalPlayer ? "HUMAN" : "AI");
     }
 
     int finalTeamId = 0;
@@ -87,23 +85,15 @@ MapTransformer::applyToWorld(const MapDefinition &def,
     if (overrideIt != s_playerTeamOverrides.end()) {
 
       finalTeamId = overrideIt->second;
-      qDebug() << "[MapTransformer] Player" << playerId
-               << "team from UI:" << finalTeamId;
     } else {
 
       auto teamIt = playerIdToTeam.find(playerId);
       if (teamIt != playerIdToTeam.end()) {
         finalTeamId = teamIt->second;
-        qDebug() << "[MapTransformer] Player" << playerId
-                 << "team from MAP:" << finalTeamId;
       } else {
-        qDebug() << "[MapTransformer] Player" << playerId
-                 << "no team specified, defaulting to 0 (FFA)";
       }
     }
     ownerRegistry.setOwnerTeam(playerId, finalTeamId);
-    qDebug() << "[MapTransformer] Player" << playerId
-             << "FINAL team set to:" << finalTeamId;
   }
 
   for (const auto &s : def.spawns) {
@@ -177,11 +167,7 @@ MapTransformer::applyToWorld(const MapDefinition &def,
           !Game::Systems::OwnerRegistry::instance().isPlayer(s.playerId);
       if (isAI) {
         e->addComponent<Engine::Core::AIControlledComponent>();
-        qDebug() << "[MapTransformer] Unit" << e->getId() << "for player"
-                 << s.playerId << "marked as AI-controlled";
       } else {
-        qDebug() << "[MapTransformer] Unit" << e->getId() << "for player"
-                 << s.playerId << "is PLAYER-controlled";
       }
 
       if (auto *existingMv =

+ 0 - 9
game/map/terrain.cpp

@@ -63,19 +63,10 @@ void TerrainHeightMap::buildFromFeatures(
   std::fill(m_hillEntrances.begin(), m_hillEntrances.end(), false);
   std::fill(m_hillWalkable.begin(), m_hillWalkable.end(), false);
 
-  qDebug() << "Building terrain from" << features.size() << "features";
-
   const float gridHalfWidth = m_width * 0.5f - 0.5f;
   const float gridHalfHeight = m_height * 0.5f - 0.5f;
 
   for (const auto &feature : features) {
-    qDebug() << "  Feature:"
-             << (feature.type == TerrainType::Mountain ? "Mountain"
-                 : feature.type == TerrainType::Hill   ? "Hill"
-                                                       : "Flat")
-             << "at (" << feature.centerX << "," << feature.centerZ << ")"
-             << "width:" << feature.width << "depth:" << feature.depth
-             << "height:" << feature.height;
 
     const float gridCenterX = (feature.centerX / m_tileSize) + gridHalfWidth;
     const float gridCenterZ = (feature.centerZ / m_tileSize) + gridHalfHeight;

+ 0 - 3
game/map/terrain_service.cpp

@@ -18,9 +18,6 @@ void TerrainService::initialize(const MapDefinition &mapDef) {
   m_heightMap->buildFromFeatures(mapDef.terrain);
   m_biomeSettings = mapDef.biome;
   m_heightMap->applyBiomeVariation(m_biomeSettings);
-
-  qDebug() << "TerrainService initialized with" << mapDef.terrain.size()
-           << "terrain features";
 }
 
 float TerrainService::getTerrainHeight(float worldX, float worldZ) const {

+ 0 - 12
game/systems/command_service.cpp

@@ -362,8 +362,6 @@ void CommandService::moveGroup(Engine::Core::World &world,
   }
 
   if (movingMembers.empty()) {
-    qDebug() << "[CommandService] Group move cancelled: all units are engaged "
-                "in combat";
     return;
   }
 
@@ -384,8 +382,6 @@ void CommandService::moveGroup(Engine::Core::World &world,
     }
 
     if (anyTargetInvalid) {
-      qDebug() << "[CommandService] Group move cancelled: one or more targets "
-                  "are invalid/unwalkable";
       return;
     }
   }
@@ -443,14 +439,10 @@ void CommandService::moveGroup(Engine::Core::World &world,
       mv->pendingRequestId = 0;
       unitsNeedingNewPath.push_back(&member);
     } else {
-      qDebug() << "[CommandService] Unit" << member.id
-               << "already moving to goal, keeping existing path";
     }
   }
 
   if (unitsNeedingNewPath.empty()) {
-    qDebug() << "[CommandService] All units already moving to goal, skipping "
-                "path recalculation";
     return;
   }
 
@@ -527,10 +519,6 @@ void CommandService::moveGroup(Engine::Core::World &world,
     }
   }
 
-  qDebug() << "[CommandService] Submitted group path request for"
-           << unitsNeedingNewPath.size() << "units (out of" << members.size()
-           << "total)";
-
   s_pathfinder->submitPathRequest(requestId, start, end);
 }
 

+ 0 - 11
game/systems/nation_registry.cpp

@@ -91,16 +91,11 @@ const Nation *NationRegistry::getNationForPlayer(int playerId) const {
   auto it = m_playerNations.find(playerId);
   if (it != m_playerNations.end()) {
     auto *nation = getNation(it->second);
-    qDebug() << "[NationRegistry] Player" << playerId
-             << "assigned to nation:" << QString::fromStdString(it->second);
     return nation;
   }
 
   auto *nation = getNation(m_defaultNation);
   if (!nation) {
-    qDebug() << "[NationRegistry] ERROR: No default nation ("
-             << QString::fromStdString(m_defaultNation) << ") found for player"
-             << playerId;
   }
   return nation;
 }
@@ -113,8 +108,6 @@ void NationRegistry::setPlayerNation(int playerId,
 void NationRegistry::initializeDefaults() {
   clear();
 
-  qDebug() << "[NationRegistry] Initializing default nations...";
-
   Nation kingdomOfIron;
   kingdomOfIron.id = "kingdom_of_iron";
   kingdomOfIron.displayName = "Kingdom of Iron";
@@ -132,10 +125,6 @@ void NationRegistry::initializeDefaults() {
   registerNation(std::move(kingdomOfIron));
 
   m_defaultNation = "kingdom_of_iron";
-
-  qDebug() << "[NationRegistry] Registered nation:"
-           << QString::fromStdString(m_defaultNation) << "with"
-           << m_nations[0].availableTroops.size() << "troop types";
 }
 
 void NationRegistry::clear() {

+ 0 - 7
game/systems/owner_registry.cpp

@@ -167,13 +167,6 @@ bool OwnerRegistry::areAllies(int ownerId1, int ownerId2) const {
 
   bool result = (team1 == team2);
 
-  static int logCount = 0;
-  if (result && logCount < 5) {
-    qDebug() << "[OwnerRegistry] Players" << ownerId1 << "and" << ownerId2
-             << "are ALLIES (both team" << team1 << ")";
-    logCount++;
-  }
-
   return result;
 }
 

+ 0 - 4
game/units/archer.cpp

@@ -54,11 +54,7 @@ void Archer::init(const SpawnParams &params) {
 
   if (params.aiControlled) {
     e->addComponent<Engine::Core::AIControlledComponent>();
-    std::cout << "[Archer] Created AI-controlled archer for player "
-              << params.playerId << " at entity ID " << e->getId() << std::endl;
   } else {
-    std::cout << "[Archer] Created player-controlled archer for player "
-              << params.playerId << " at entity ID " << e->getId() << std::endl;
   }
 
   QVector3D tc = teamColor(m_u->ownerId);

+ 0 - 4
game/units/barracks.cpp

@@ -42,11 +42,7 @@ void Barracks::init(const SpawnParams &params) {
 
   if (params.aiControlled) {
     e->addComponent<Engine::Core::AIControlledComponent>();
-    std::cout << "[Barracks] Created AI-controlled barracks for player "
-              << params.playerId << " at entity ID " << e->getId() << std::endl;
   } else {
-    std::cout << "[Barracks] Created player-controlled barracks for player "
-              << params.playerId << " at entity ID " << e->getId() << std::endl;
   }
 
   QVector3D tc = Game::Visuals::teamColorForOwner(m_u->ownerId);

+ 0 - 3
main.cpp

@@ -86,8 +86,5 @@ int main(int argc, char *argv[]) {
                      app.exit(3);
                    });
 
-  qDebug() << "Application started successfully";
-  qDebug() << "Assets directory:" << QDir::currentPath() + "/assets";
-
   return app.exec();
 }