Browse Source

Convert component usages and selection_system to snake_case

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 5 days ago
parent
commit
bb5fca6d49
39 changed files with 567 additions and 567 deletions
  1. 3 3
      app/controllers/command_controller.cpp
  2. 10 10
      app/core/game_engine.cpp
  3. 8 8
      app/utils/movement_utils.h
  4. 83 83
      game/core/serialization.cpp
  5. 4 4
      game/systems/ai_system/ai_command_applier.cpp
  6. 5 5
      game/systems/ai_system/ai_reasoner.cpp
  7. 10 10
      game/systems/ai_system/ai_snapshot_builder.cpp
  8. 1 1
      game/systems/ai_system/behaviors/attack_behavior.cpp
  9. 1 1
      game/systems/ai_system/behaviors/defend_behavior.cpp
  10. 2 2
      game/systems/ai_system/behaviors/gather_behavior.cpp
  11. 2 2
      game/systems/ai_system/behaviors/production_behavior.cpp
  12. 22 22
      game/systems/capture_system.cpp
  13. 81 81
      game/systems/combat_system.cpp
  14. 60 60
      game/systems/command_service.cpp
  15. 33 33
      game/systems/movement_system.cpp
  16. 1 1
      game/systems/nation_loader.cpp
  17. 1 1
      game/systems/nation_registry.cpp
  18. 8 8
      game/systems/patrol_system.cpp
  19. 20 20
      game/systems/production_service.cpp
  20. 21 21
      game/systems/production_system.cpp
  21. 42 42
      game/systems/selection_system.cpp
  22. 25 25
      game/systems/selection_system.h
  23. 1 1
      game/systems/troop_profile_service.cpp
  24. 11 11
      game/units/archer.cpp
  25. 10 10
      game/units/ballista.cpp
  26. 10 10
      game/units/barracks.cpp
  27. 11 11
      game/units/catapult.cpp
  28. 3 3
      game/units/healer.cpp
  29. 11 11
      game/units/horse_archer.cpp
  30. 11 11
      game/units/horse_spearman.cpp
  31. 11 11
      game/units/horse_swordsman.cpp
  32. 11 11
      game/units/spearman.cpp
  33. 11 11
      game/units/swordsman.cpp
  34. 7 7
      game/units/unit.cpp
  35. 1 1
      game/visuals/visual_catalog.cpp
  36. 6 6
      render/entity/barracks_flag_renderer.h
  37. 4 4
      render/gl/humanoid/animation/animation_inputs.cpp
  38. 2 2
      render/humanoid/rig.cpp
  39. 3 3
      render/scene_renderer.cpp

+ 3 - 3
app/controllers/command_controller.cpp

@@ -161,9 +161,9 @@ auto CommandController::onHoldCommand() -> CommandResult {
 
     auto *movement = entity->getComponent<Engine::Core::MovementComponent>();
     if (movement != nullptr) {
-      movement->hasTarget = false;
+      movement->has_target = false;
       movement->path.clear();
-      movement->pathPending = false;
+      movement->path_pending = false;
       movement->vx = 0.0F;
       movement->vz = 0.0F;
     }
@@ -237,7 +237,7 @@ auto CommandController::onPatrolClick(qreal sx, qreal sy, int viewportWidth,
       patrol->waypoints.emplace_back(m_patrolFirstWaypoint.x(),
                                      m_patrolFirstWaypoint.z());
       patrol->waypoints.emplace_back(second_waypoint.x(), second_waypoint.z());
-      patrol->currentWaypoint = 0;
+      patrol->current_waypoint = 0;
       patrol->patrolling = true;
     }
 

+ 10 - 10
app/core/game_engine.cpp

@@ -233,13 +233,13 @@ GameEngine::GameEngine(QObject *parent)
           &GameEngine::global_cursor_changed);
 
   connect(m_selectionController.get(),
-          &Game::Systems::SelectionController::selectionChanged, this,
+          &Game::Systems::SelectionController::selection_changed, this,
           &GameEngine::selected_units_changed);
   connect(m_selectionController.get(),
-          &Game::Systems::SelectionController::selectionChanged, this,
+          &Game::Systems::SelectionController::selection_changed, this,
           &GameEngine::sync_selection_flags);
   connect(m_selectionController.get(),
-          &Game::Systems::SelectionController::selectionModelRefreshRequested,
+          &Game::Systems::SelectionController::selection_model_refresh_requested,
           this, &GameEngine::selected_units_data_changed);
   connect(m_commandController.get(),
           &App::Controllers::CommandController::attack_targetSelected,
@@ -965,20 +965,20 @@ auto GameEngine::get_selected_production_state() const -> QVariantMap {
       *m_world, selection_system->getSelectedUnits(), m_runtime.localOwnerId,
       st);
   m["has_barracks"] = st.has_barracks;
-  m["inProgress"] = st.inProgress;
+  m["inProgress"] = st.in_progress;
   m["product_type"] =
       QString::fromStdString(Game::Units::troop_typeToString(st.product_type));
-  m["timeRemaining"] = st.timeRemaining;
-  m["buildTime"] = st.buildTime;
-  m["producedCount"] = st.producedCount;
-  m["maxUnits"] = st.maxUnits;
-  m["villagerCost"] = st.villagerCost;
+  m["timeRemaining"] = st.time_remaining;
+  m["buildTime"] = st.build_time;
+  m["producedCount"] = st.produced_count;
+  m["maxUnits"] = st.max_units;
+  m["villagerCost"] = st.villager_cost;
   m["queueSize"] = st.queueSize;
   m["nation_id"] =
       QString::fromStdString(Game::Systems::nationIDToString(st.nation_id));
 
   QVariantList queue_list;
-  for (const auto &unit_type : st.productionQueue) {
+  for (const auto &unit_type : st.production_queue) {
     queue_list.append(
         QString::fromStdString(Game::Units::troop_typeToString(unit_type)));
   }

+ 8 - 8
app/utils/movement_utils.h

@@ -16,21 +16,21 @@ inline void reset_movement(Engine::Core::Entity *entity) {
   }
 
   auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
-  movement->hasTarget = false;
+  movement->has_target = false;
   movement->path.clear();
-  movement->pathPending = false;
-  movement->pendingRequestId = 0;
-  movement->repathCooldown = 0.0F;
+  movement->path_pending = false;
+  movement->pending_request_id = 0;
+  movement->repath_cooldown = 0.0F;
   if (transform != nullptr) {
     movement->target_x = transform->position.x;
     movement->target_y = transform->position.z;
-    movement->goalX = transform->position.x;
-    movement->goalY = transform->position.z;
+    movement->goal_x = transform->position.x;
+    movement->goal_y = transform->position.z;
   } else {
     movement->target_x = 0.0F;
     movement->target_y = 0.0F;
-    movement->goalX = 0.0F;
-    movement->goalY = 0.0F;
+    movement->goal_x = 0.0F;
+    movement->goal_y = 0.0F;
   }
 }
 

+ 83 - 83
game/core/serialization.cpp

@@ -90,19 +90,19 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     transform_obj["scale_x"] = transform->scale.x;
     transform_obj["scaleY"] = transform->scale.y;
     transform_obj["scale_z"] = transform->scale.z;
-    transform_obj["hasDesiredYaw"] = transform->hasDesiredYaw;
-    transform_obj["desiredYaw"] = transform->desiredYaw;
+    transform_obj["hasDesiredYaw"] = transform->has_desired_yaw;
+    transform_obj["desiredYaw"] = transform->desired_yaw;
     entity_obj["transform"] = transform_obj;
   }
 
   if (const auto *renderable = entity->getComponent<RenderableComponent>()) {
     QJsonObject renderable_obj;
-    renderable_obj["meshPath"] = QString::fromStdString(renderable->meshPath);
+    renderable_obj["meshPath"] = QString::fromStdString(renderable->mesh_path);
     renderable_obj["texturePath"] =
-        QString::fromStdString(renderable->texturePath);
-    if (!renderable->rendererId.empty()) {
+        QString::fromStdString(renderable->texture_path);
+    if (!renderable->renderer_id.empty()) {
       renderable_obj["rendererId"] =
-          QString::fromStdString(renderable->rendererId);
+          QString::fromStdString(renderable->renderer_id);
     }
     renderable_obj["visible"] = renderable->visible;
     renderable_obj["mesh"] = static_cast<int>(renderable->mesh);
@@ -125,21 +125,21 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
 
   if (const auto *movement = entity->getComponent<MovementComponent>()) {
     QJsonObject movement_obj;
-    movement_obj["hasTarget"] = movement->hasTarget;
+    movement_obj["hasTarget"] = movement->has_target;
     movement_obj["target_x"] = movement->target_x;
     movement_obj["target_y"] = movement->target_y;
-    movement_obj["goalX"] = movement->goalX;
-    movement_obj["goalY"] = movement->goalY;
+    movement_obj["goalX"] = movement->goal_x;
+    movement_obj["goalY"] = movement->goal_y;
     movement_obj["vx"] = movement->vx;
     movement_obj["vz"] = movement->vz;
-    movement_obj["pathPending"] = movement->pathPending;
+    movement_obj["pathPending"] = movement->path_pending;
     movement_obj["pendingRequestId"] =
-        static_cast<qint64>(movement->pendingRequestId);
-    movement_obj["repathCooldown"] = movement->repathCooldown;
-    movement_obj["lastGoalX"] = movement->lastGoalX;
-    movement_obj["lastGoalY"] = movement->lastGoalY;
+        static_cast<qint64>(movement->pending_request_id);
+    movement_obj["repathCooldown"] = movement->repath_cooldown;
+    movement_obj["lastGoalX"] = movement->last_goal_x;
+    movement_obj["lastGoalY"] = movement->last_goal_y;
     movement_obj["timeSinceLastPathRequest"] =
-        movement->timeSinceLastPathRequest;
+        movement->time_since_last_path_request;
 
     QJsonArray path_array;
     for (const auto &waypoint : movement->path) {
@@ -157,18 +157,18 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     attack_obj["range"] = attack->range;
     attack_obj["damage"] = attack->damage;
     attack_obj["cooldown"] = attack->cooldown;
-    attack_obj["timeSinceLast"] = attack->timeSinceLast;
-    attack_obj["meleeRange"] = attack->meleeRange;
-    attack_obj["meleeDamage"] = attack->meleeDamage;
-    attack_obj["meleeCooldown"] = attack->meleeCooldown;
-    attack_obj["preferredMode"] = combatModeToString(attack->preferredMode);
-    attack_obj["currentMode"] = combatModeToString(attack->currentMode);
-    attack_obj["canMelee"] = attack->canMelee;
-    attack_obj["canRanged"] = attack->canRanged;
-    attack_obj["max_heightDifference"] = attack->max_heightDifference;
-    attack_obj["inMeleeLock"] = attack->inMeleeLock;
+    attack_obj["timeSinceLast"] = attack->time_since_last;
+    attack_obj["meleeRange"] = attack->melee_range;
+    attack_obj["meleeDamage"] = attack->melee_damage;
+    attack_obj["meleeCooldown"] = attack->melee_cooldown;
+    attack_obj["preferredMode"] = combatModeToString(attack->preferred_mode);
+    attack_obj["currentMode"] = combatModeToString(attack->current_mode);
+    attack_obj["canMelee"] = attack->can_melee;
+    attack_obj["canRanged"] = attack->can_ranged;
+    attack_obj["max_heightDifference"] = attack->max_height_difference;
+    attack_obj["inMeleeLock"] = attack->in_melee_lock;
     attack_obj["meleeLockTargetId"] =
-        static_cast<qint64>(attack->meleeLockTargetId);
+        static_cast<qint64>(attack->melee_lock_target_id);
     entity_obj["attack"] = attack_obj;
   }
 
@@ -177,13 +177,13 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     QJsonObject attack_target_obj;
     attack_target_obj["target_id"] =
         static_cast<qint64>(attack_target->target_id);
-    attack_target_obj["shouldChase"] = attack_target->shouldChase;
+    attack_target_obj["shouldChase"] = attack_target->should_chase;
     entity_obj["attack_target"] = attack_target_obj;
   }
 
   if (const auto *patrol = entity->getComponent<PatrolComponent>()) {
     QJsonObject patrol_obj;
-    patrol_obj["currentWaypoint"] = static_cast<int>(patrol->currentWaypoint);
+    patrol_obj["currentWaypoint"] = static_cast<int>(patrol->current_waypoint);
     patrol_obj["patrolling"] = patrol->patrolling;
 
     QJsonArray waypoints_array;
@@ -203,20 +203,20 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
 
   if (const auto *production = entity->getComponent<ProductionComponent>()) {
     QJsonObject production_obj;
-    production_obj["inProgress"] = production->inProgress;
-    production_obj["buildTime"] = production->buildTime;
-    production_obj["timeRemaining"] = production->timeRemaining;
-    production_obj["producedCount"] = production->producedCount;
-    production_obj["maxUnits"] = production->maxUnits;
+    production_obj["inProgress"] = production->in_progress;
+    production_obj["buildTime"] = production->build_time;
+    production_obj["timeRemaining"] = production->time_remaining;
+    production_obj["producedCount"] = production->produced_count;
+    production_obj["maxUnits"] = production->max_units;
     production_obj["product_type"] = QString::fromStdString(
         Game::Units::troop_typeToString(production->product_type));
-    production_obj["rallyX"] = production->rallyX;
-    production_obj["rallyZ"] = production->rallyZ;
-    production_obj["rallySet"] = production->rallySet;
-    production_obj["villagerCost"] = production->villagerCost;
+    production_obj["rallyX"] = production->rally_x;
+    production_obj["rallyZ"] = production->rally_z;
+    production_obj["rallySet"] = production->rally_set;
+    production_obj["villagerCost"] = production->villager_cost;
 
     QJsonArray queue_array;
-    for (const auto &queued : production->productionQueue) {
+    for (const auto &queued : production->production_queue) {
       queue_array.append(
           QString::fromStdString(Game::Units::troop_typeToString(queued)));
     }
@@ -232,9 +232,9 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     QJsonObject capture_obj;
     capture_obj["capturing_player_id"] = capture->capturing_player_id;
     capture_obj["captureProgress"] =
-        static_cast<double>(capture->captureProgress);
-    capture_obj["requiredTime"] = static_cast<double>(capture->requiredTime);
-    capture_obj["isBeingCaptured"] = capture->isBeingCaptured;
+        static_cast<double>(capture->capture_progress);
+    capture_obj["requiredTime"] = static_cast<double>(capture->required_time);
+    capture_obj["isBeingCaptured"] = capture->is_being_captured;
     entity_obj["capture"] = capture_obj;
   }
 
@@ -262,18 +262,18 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     transform->scale.y = static_cast<float>(transform_obj["scaleY"].toDouble());
     transform->scale.z =
         static_cast<float>(transform_obj["scale_z"].toDouble());
-    transform->hasDesiredYaw = transform_obj["hasDesiredYaw"].toBool(false);
-    transform->desiredYaw =
+    transform->has_desired_yaw = transform_obj["hasDesiredYaw"].toBool(false);
+    transform->desired_yaw =
         static_cast<float>(transform_obj["desiredYaw"].toDouble());
   }
 
   if (json.contains("renderable")) {
     const auto renderable_obj = json["renderable"].toObject();
     auto *renderable = entity->addComponent<RenderableComponent>("", "");
-    renderable->meshPath = renderable_obj["meshPath"].toString().toStdString();
-    renderable->texturePath =
+    renderable->mesh_path = renderable_obj["meshPath"].toString().toStdString();
+    renderable->texture_path =
         renderable_obj["texturePath"].toString().toStdString();
-    renderable->rendererId =
+    renderable->renderer_id =
         renderable_obj["rendererId"].toString().toStdString();
     renderable->visible = renderable_obj["visible"].toBool(true);
     renderable->mesh =
@@ -321,25 +321,25 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
   if (json.contains("movement")) {
     const auto movement_obj = json["movement"].toObject();
     auto *movement = entity->addComponent<MovementComponent>();
-    movement->hasTarget = movement_obj["hasTarget"].toBool(false);
+    movement->has_target = movement_obj["hasTarget"].toBool(false);
     movement->target_x =
         static_cast<float>(movement_obj["target_x"].toDouble());
     movement->target_y =
         static_cast<float>(movement_obj["target_y"].toDouble());
-    movement->goalX = static_cast<float>(movement_obj["goalX"].toDouble());
-    movement->goalY = static_cast<float>(movement_obj["goalY"].toDouble());
+    movement->goal_x = static_cast<float>(movement_obj["goalX"].toDouble());
+    movement->goal_y = static_cast<float>(movement_obj["goalY"].toDouble());
     movement->vx = static_cast<float>(movement_obj["vx"].toDouble());
     movement->vz = static_cast<float>(movement_obj["vz"].toDouble());
-    movement->pathPending = movement_obj["pathPending"].toBool(false);
-    movement->pendingRequestId = static_cast<std::uint64_t>(
+    movement->path_pending = movement_obj["pathPending"].toBool(false);
+    movement->pending_request_id = static_cast<std::uint64_t>(
         movement_obj["pendingRequestId"].toVariant().toULongLong());
-    movement->repathCooldown =
+    movement->repath_cooldown =
         static_cast<float>(movement_obj["repathCooldown"].toDouble());
-    movement->lastGoalX =
+    movement->last_goal_x =
         static_cast<float>(movement_obj["lastGoalX"].toDouble());
-    movement->lastGoalY =
+    movement->last_goal_y =
         static_cast<float>(movement_obj["lastGoalY"].toDouble());
-    movement->timeSinceLastPathRequest =
+    movement->time_since_last_path_request =
         static_cast<float>(movement_obj["timeSinceLastPathRequest"].toDouble());
 
     movement->path.clear();
@@ -359,24 +359,24 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     attack->range = static_cast<float>(attack_obj["range"].toDouble());
     attack->damage = attack_obj["damage"].toInt(0);
     attack->cooldown = static_cast<float>(attack_obj["cooldown"].toDouble());
-    attack->timeSinceLast =
+    attack->time_since_last =
         static_cast<float>(attack_obj["timeSinceLast"].toDouble());
-    attack->meleeRange = static_cast<float>(attack_obj["meleeRange"].toDouble(
+    attack->melee_range = static_cast<float>(attack_obj["meleeRange"].toDouble(
         static_cast<double>(Defaults::kAttackMeleeRange)));
-    attack->meleeDamage = attack_obj["meleeDamage"].toInt(0);
-    attack->meleeCooldown =
+    attack->melee_damage = attack_obj["meleeDamage"].toInt(0);
+    attack->melee_cooldown =
         static_cast<float>(attack_obj["meleeCooldown"].toDouble());
-    attack->preferredMode =
+    attack->preferred_mode =
         combatModeFromString(attack_obj["preferredMode"].toString());
-    attack->currentMode =
+    attack->current_mode =
         combatModeFromString(attack_obj["currentMode"].toString());
-    attack->canMelee = attack_obj["canMelee"].toBool(true);
-    attack->canRanged = attack_obj["canRanged"].toBool(false);
-    attack->max_heightDifference =
+    attack->can_melee = attack_obj["canMelee"].toBool(true);
+    attack->can_ranged = attack_obj["canRanged"].toBool(false);
+    attack->max_height_difference =
         static_cast<float>(attack_obj["max_heightDifference"].toDouble(
             static_cast<double>(Defaults::kAttackHeightTolerance)));
-    attack->inMeleeLock = attack_obj["inMeleeLock"].toBool(false);
-    attack->meleeLockTargetId = static_cast<EntityID>(
+    attack->in_melee_lock = attack_obj["inMeleeLock"].toBool(false);
+    attack->melee_lock_target_id = static_cast<EntityID>(
         attack_obj["meleeLockTargetId"].toVariant().toULongLong());
   }
 
@@ -385,13 +385,13 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     auto *attack_target = entity->addComponent<AttackTargetComponent>();
     attack_target->target_id = static_cast<EntityID>(
         attack_target_obj["target_id"].toVariant().toULongLong());
-    attack_target->shouldChase = attack_target_obj["shouldChase"].toBool(false);
+    attack_target->should_chase = attack_target_obj["shouldChase"].toBool(false);
   }
 
   if (json.contains("patrol")) {
     const auto patrol_obj = json["patrol"].toObject();
     auto *patrol = entity->addComponent<PatrolComponent>();
-    patrol->currentWaypoint =
+    patrol->current_waypoint =
         static_cast<size_t>(std::max(0, patrol_obj["currentWaypoint"].toInt()));
     patrol->patrolling = patrol_obj["patrolling"].toBool(false);
 
@@ -413,27 +413,27 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
   if (json.contains("production")) {
     const auto production_obj = json["production"].toObject();
     auto *production = entity->addComponent<ProductionComponent>();
-    production->inProgress = production_obj["inProgress"].toBool(false);
-    production->buildTime =
+    production->in_progress = production_obj["inProgress"].toBool(false);
+    production->build_time =
         static_cast<float>(production_obj["buildTime"].toDouble());
-    production->timeRemaining =
+    production->time_remaining =
         static_cast<float>(production_obj["timeRemaining"].toDouble());
-    production->producedCount = production_obj["producedCount"].toInt(0);
-    production->maxUnits = production_obj["maxUnits"].toInt(0);
+    production->produced_count = production_obj["producedCount"].toInt(0);
+    production->max_units = production_obj["maxUnits"].toInt(0);
     production->product_type = Game::Units::troop_typeFromString(
         production_obj["product_type"].toString().toStdString());
-    production->rallyX =
+    production->rally_x =
         static_cast<float>(production_obj["rallyX"].toDouble());
-    production->rallyZ =
+    production->rally_z =
         static_cast<float>(production_obj["rallyZ"].toDouble());
-    production->rallySet = production_obj["rallySet"].toBool(false);
-    production->villagerCost = production_obj["villagerCost"].toInt(1);
+    production->rally_set = production_obj["rallySet"].toBool(false);
+    production->villager_cost = production_obj["villagerCost"].toInt(1);
 
-    production->productionQueue.clear();
+    production->production_queue.clear();
     const auto queue_array = production_obj["queue"].toArray();
-    production->productionQueue.reserve(queue_array.size());
+    production->production_queue.reserve(queue_array.size());
     for (const auto &value : queue_array) {
-      production->productionQueue.push_back(
+      production->production_queue.push_back(
           Game::Units::troop_typeFromString(value.toString().toStdString()));
     }
   }
@@ -446,12 +446,12 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     const auto capture_obj = json["capture"].toObject();
     auto *capture = entity->addComponent<CaptureComponent>();
     capture->capturing_player_id = capture_obj["capturing_player_id"].toInt(-1);
-    capture->captureProgress =
+    capture->capture_progress =
         static_cast<float>(capture_obj["captureProgress"].toDouble(0.0));
-    capture->requiredTime =
+    capture->required_time =
         static_cast<float>(capture_obj["requiredTime"].toDouble(
             static_cast<double>(Defaults::kCaptureRequiredTime)));
-    capture->isBeingCaptured = capture_obj["isBeingCaptured"].toBool(false);
+    capture->is_being_captured = capture_obj["isBeingCaptured"].toBool(false);
   }
 }
 

+ 4 - 4
game/systems/ai_system/ai_command_applier.cpp

@@ -105,7 +105,7 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
       }
 
       CommandService::attack_target(world, owned_units, command.target_id,
-                                    command.shouldChase);
+                                    command.should_chase);
       break;
     }
 
@@ -121,7 +121,7 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
         break;
       }
 
-      if (production->inProgress) {
+      if (production->in_progress) {
         break;
       }
 
@@ -144,8 +144,8 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
 
       production->product_type = command.product_type;
 
-      production->timeRemaining = production->buildTime;
-      production->inProgress = true;
+      production->time_remaining = production->build_time;
+      production->in_progress = true;
 
       break;
     }

+ 5 - 5
game/systems/ai_system/ai_reasoner.cpp

@@ -29,8 +29,8 @@ void AIReasoner::updateContext(const AISnapshot &snapshot, AIContext &ctx) {
   ctx.rangedCount = 0;
   ctx.damagedUnitsCount = 0;
   ctx.averageHealth = 1.0F;
-  ctx.rallyX = 0.0F;
-  ctx.rallyZ = 0.0F;
+  ctx.rally_x = 0.0F;
+  ctx.rally_z = 0.0F;
   ctx.barracksUnderThreat = false;
   ctx.nearbyThreatCount = 0;
   ctx.closest_threatDistance = std::numeric_limits<float>::infinity();
@@ -71,8 +71,8 @@ void AIReasoner::updateContext(const AISnapshot &snapshot, AIContext &ctx) {
       if (entity.spawn_type == Game::Units::SpawnType::Barracks &&
           ctx.primaryBarracks == 0) {
         ctx.primaryBarracks = entity.id;
-        ctx.rallyX = entity.posX - 5.0F;
-        ctx.rallyZ = entity.posZ;
+        ctx.rally_x = entity.posX - 5.0F;
+        ctx.rally_z = entity.posZ;
         ctx.basePosX = entity.posX;
         ctx.basePosY = entity.posY;
         ctx.basePosZ = entity.posZ;
@@ -96,7 +96,7 @@ void AIReasoner::updateContext(const AISnapshot &snapshot, AIContext &ctx) {
       }
     }
 
-    if (!entity.movement.hasComponent || !entity.movement.hasTarget) {
+    if (!entity.movement.hasComponent || !entity.movement.has_target) {
       ctx.idleUnits++;
     } else {
       ctx.combatUnits++;

+ 10 - 10
game/systems/ai_system/ai_snapshot_builder.cpp

@@ -54,23 +54,23 @@ auto AISnapshotBuilder::build(const Engine::Core::World &world,
     if (auto *movement =
             entity->getComponent<Engine::Core::MovementComponent>()) {
       data.movement.hasComponent = true;
-      data.movement.hasTarget = movement->hasTarget;
+      data.movement.has_target = movement->has_target;
     }
 
     if (auto *production =
             entity->getComponent<Engine::Core::ProductionComponent>()) {
       data.production.hasComponent = true;
-      data.production.inProgress = production->inProgress;
-      data.production.buildTime = production->buildTime;
-      data.production.timeRemaining = production->timeRemaining;
-      data.production.producedCount = production->producedCount;
-      data.production.maxUnits = production->maxUnits;
+      data.production.in_progress = production->in_progress;
+      data.production.build_time = production->build_time;
+      data.production.time_remaining = production->time_remaining;
+      data.production.produced_count = production->produced_count;
+      data.production.max_units = production->max_units;
       data.production.product_type = production->product_type;
-      data.production.rallySet = production->rallySet;
-      data.production.rallyX = production->rallyX;
-      data.production.rallyZ = production->rallyZ;
+      data.production.rally_set = production->rally_set;
+      data.production.rally_x = production->rally_x;
+      data.production.rally_z = production->rally_z;
       data.production.queueSize =
-          static_cast<int>(production->productionQueue.size());
+          static_cast<int>(production->production_queue.size());
     }
 
     snapshot.friendlies.push_back(std::move(data));

+ 1 - 1
game/systems/ai_system/behaviors/attack_behavior.cpp

@@ -248,7 +248,7 @@ void AttackBehavior::execute(const AISnapshot &snapshot, AIContext &context,
       (context.state == AIState::Attacking || context.barracksUnderThreat) &&
       assessment.forceRatio >= 0.8F;
 
-  command.shouldChase = should_chase_aggressive;
+  command.should_chase = should_chase_aggressive;
 
   outCommands.push_back(std::move(command));
 }

+ 1 - 1
game/systems/ai_system/behaviors/defend_behavior.cpp

@@ -149,7 +149,7 @@ void DefendBehavior::execute(const AISnapshot &snapshot, AIContext &context,
           attack.type = AICommandType::AttackTarget;
           attack.units = std::move(claimed_units);
           attack.target_id = target_info.target_id;
-          attack.shouldChase = true;
+          attack.should_chase = true;
           outCommands.push_back(std::move(attack));
           return;
         }

+ 2 - 2
game/systems/ai_system/behaviors/gather_behavior.cpp

@@ -27,7 +27,7 @@ void GatherBehavior::execute(const AISnapshot &snapshot, AIContext &context,
     return;
   }
 
-  QVector3D const rally_point(context.rallyX, 0.0F, context.rallyZ);
+  QVector3D const rally_point(context.rally_x, 0.0F, context.rally_z);
 
   std::vector<const EntitySnapshot *> units_to_gather;
   units_to_gather.reserve(snapshot.friendlies.size());
@@ -133,7 +133,7 @@ auto GatherBehavior::should_execute(const AISnapshot &snapshot,
 
   if (context.state == AIState::Defending) {
 
-    QVector3D const rally_point(context.rallyX, 0.0F, context.rallyZ);
+    QVector3D const rally_point(context.rally_x, 0.0F, context.rally_z);
     for (const auto &entity : snapshot.friendlies) {
       if (entity.isBuilding) {
         continue;

+ 2 - 2
game/systems/ai_system/behaviors/production_behavior.cpp

@@ -73,12 +73,12 @@ void ProductionBehavior::execute(const AISnapshot &snapshot, AIContext &context,
 
     const auto &prod = entity.production;
 
-    if (prod.producedCount >= prod.maxUnits) {
+    if (prod.produced_count >= prod.max_units) {
       continue;
     }
 
     const int max_queue_size = 5;
-    int const total_in_queue = (prod.inProgress ? 1 : 0) + prod.queueSize;
+    int const total_in_queue = (prod.in_progress ? 1 : 0) + prod.queueSize;
     if (total_in_queue >= max_queue_size) {
       continue;
     }

+ 22 - 22
game/systems/capture_system.cpp

@@ -96,25 +96,25 @@ void CaptureSystem::transferBarrackOwnership(Engine::Core::World *,
     prod = barrack->addComponent<Engine::Core::ProductionComponent>();
     if (prod != nullptr) {
       prod->product_type = Game::Units::TroopType::Archer;
-      prod->maxUnits = 150;
-      prod->inProgress = false;
-      prod->timeRemaining = 0.0F;
-      prod->producedCount = 0;
-      prod->rallyX = transform->position.x + 4.0F;
-      prod->rallyZ = transform->position.z + 2.0F;
-      prod->rallySet = true;
+      prod->max_units = 150;
+      prod->in_progress = false;
+      prod->time_remaining = 0.0F;
+      prod->produced_count = 0;
+      prod->rally_x = transform->position.x + 4.0F;
+      prod->rally_z = transform->position.z + 2.0F;
+      prod->rally_set = true;
       const auto profile = TroopProfileService::instance().get_profile(
           unit->nation_id, prod->product_type);
-      prod->buildTime = profile.production.build_time;
-      prod->villagerCost = profile.individuals_per_unit;
+      prod->build_time = profile.production.build_time;
+      prod->villager_cost = profile.individuals_per_unit;
     }
   } else if (Game::Core::isNeutralOwner(newOwnerId) && (prod != nullptr)) {
     barrack->removeComponent<Engine::Core::ProductionComponent>();
   } else if (prod != nullptr) {
     const auto profile = TroopProfileService::instance().get_profile(
         unit->nation_id, prod->product_type);
-    prod->buildTime = profile.production.build_time;
-    prod->villagerCost = profile.individuals_per_unit;
+    prod->build_time = profile.production.build_time;
+    prod->villager_cost = profile.individuals_per_unit;
   }
 
   Engine::Core::EventManager::instance().publish(
@@ -187,24 +187,24 @@ void CaptureSystem::processBarrackCapture(Engine::Core::World *world,
     if (can_capture && capturing_player_id != -1) {
       if (capture->capturing_player_id != capturing_player_id) {
         capture->capturing_player_id = capturing_player_id;
-        capture->captureProgress = 0.0F;
+        capture->capture_progress = 0.0F;
       }
 
-      capture->isBeingCaptured = true;
-      capture->captureProgress += deltaTime;
+      capture->is_being_captured = true;
+      capture->capture_progress += deltaTime;
 
-      if (capture->captureProgress >= capture->requiredTime) {
+      if (capture->capture_progress >= capture->required_time) {
         transferBarrackOwnership(world, barrack, capturing_player_id);
-        capture->captureProgress = 0.0F;
-        capture->isBeingCaptured = false;
+        capture->capture_progress = 0.0F;
+        capture->is_being_captured = false;
         capture->capturing_player_id = -1;
       }
     } else {
-      if (capture->isBeingCaptured) {
-        capture->captureProgress -= deltaTime * 2.0F;
-        if (capture->captureProgress <= 0.0F) {
-          capture->captureProgress = 0.0F;
-          capture->isBeingCaptured = false;
+      if (capture->is_being_captured) {
+        capture->capture_progress -= deltaTime * 2.0F;
+        if (capture->capture_progress <= 0.0F) {
+          capture->capture_progress = 0.0F;
+          capture->is_being_captured = false;
           capture->capturing_player_id = -1;
         }
       }

+ 81 - 81
game/systems/combat_system.cpp

@@ -49,20 +49,20 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
       continue;
     }
 
-    if ((attacker_atk != nullptr) && attacker_atk->inMeleeLock) {
-      auto *lock_target = world->getEntity(attacker_atk->meleeLockTargetId);
+    if ((attacker_atk != nullptr) && attacker_atk->in_melee_lock) {
+      auto *lock_target = world->getEntity(attacker_atk->melee_lock_target_id);
       if ((lock_target == nullptr) ||
           lock_target->hasComponent<Engine::Core::PendingRemovalComponent>()) {
 
-        attacker_atk->inMeleeLock = false;
-        attacker_atk->meleeLockTargetId = 0;
+        attacker_atk->in_melee_lock = false;
+        attacker_atk->melee_lock_target_id = 0;
       } else {
         auto *lock_target_unit =
             lock_target->getComponent<Engine::Core::UnitComponent>();
         if ((lock_target_unit == nullptr) || lock_target_unit->health <= 0) {
 
-          attacker_atk->inMeleeLock = false;
-          attacker_atk->meleeLockTargetId = 0;
+          attacker_atk->in_melee_lock = false;
+          attacker_atk->melee_lock_target_id = 0;
         } else {
 
           auto *att_t = attacker_transform;
@@ -92,9 +92,9 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
       }
     }
 
-    if ((attacker_atk != nullptr) && attacker_atk->inMeleeLock &&
-        attacker_atk->meleeLockTargetId != 0) {
-      auto *lock_target = world->getEntity(attacker_atk->meleeLockTargetId);
+    if ((attacker_atk != nullptr) && attacker_atk->in_melee_lock &&
+        attacker_atk->melee_lock_target_id != 0) {
+      auto *lock_target = world->getEntity(attacker_atk->melee_lock_target_id);
       if ((lock_target != nullptr) &&
           !lock_target->hasComponent<Engine::Core::PendingRemovalComponent>()) {
 
@@ -105,8 +105,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
               attacker->addComponent<Engine::Core::AttackTargetComponent>();
         }
         if (attack_target != nullptr) {
-          attack_target->target_id = attacker_atk->meleeLockTargetId;
-          attack_target->shouldChase = false;
+          attack_target->target_id = attacker_atk->melee_lock_target_id;
+          attack_target->should_chase = false;
         }
       }
     }
@@ -121,9 +121,9 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
 
       updateCombatMode(attacker, world, attacker_atk);
 
-      range = attacker_atk->getCurrentRange();
-      damage = attacker_atk->getCurrentDamage();
-      cooldown = attacker_atk->getCurrentCooldown();
+      range = attacker_atk->get_current_range();
+      damage = attacker_atk->get_current_damage();
+      cooldown = attacker_atk->get_current_cooldown();
 
       auto *hold_mode =
           attacker->getComponent<Engine::Core::HoldModeComponent>();
@@ -139,8 +139,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
         }
       }
 
-      attacker_atk->timeSinceLast += deltaTime;
-      t_accum = &attacker_atk->timeSinceLast;
+      attacker_atk->time_since_last += deltaTime;
+      t_accum = &attacker_atk->time_since_last;
     } else {
       tmp_accum += deltaTime;
       t_accum = &tmp_accum;
@@ -172,8 +172,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
             best_target = target;
 
             bool is_ranged_unit = false;
-            if ((attacker_atk != nullptr) && attacker_atk->canRanged &&
-                attacker_atk->currentMode ==
+            if ((attacker_atk != nullptr) && attacker_atk->can_ranged &&
+                attacker_atk->current_mode ==
                     Engine::Core::AttackComponent::CombatMode::Ranged) {
               is_ranged_unit = true;
             }
@@ -181,16 +181,16 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
             if (is_ranged_unit) {
               auto *movement =
                   attacker->getComponent<Engine::Core::MovementComponent>();
-              if ((movement != nullptr) && movement->hasTarget) {
-                movement->hasTarget = false;
+              if ((movement != nullptr) && movement->has_target) {
+                movement->has_target = false;
                 movement->vx = 0.0F;
                 movement->vz = 0.0F;
                 movement->path.clear();
                 if (attacker_transform != nullptr) {
                   movement->target_x = attacker_transform->position.x;
                   movement->target_y = attacker_transform->position.z;
-                  movement->goalX = attacker_transform->position.x;
-                  movement->goalY = attacker_transform->position.z;
+                  movement->goal_x = attacker_transform->position.x;
+                  movement->goal_y = attacker_transform->position.z;
                 }
               }
             }
@@ -205,11 +205,11 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
                 float const dz = tgt_t->position.z - att_t->position.z;
                 float const yaw =
                     std::atan2(dx, dz) * 180.0F / std::numbers::pi_v<float>;
-                att_t->desiredYaw = yaw;
-                att_t->hasDesiredYaw = true;
+                att_t->desired_yaw = yaw;
+                att_t->has_desired_yaw = true;
               }
             }
-          } else if (attack_target->shouldChase) {
+          } else if (attack_target->should_chase) {
 
             auto *hold_mode =
                 attacker->getComponent<Engine::Core::HoldModeComponent>();
@@ -222,8 +222,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
             }
 
             bool is_ranged_unit = false;
-            if ((attacker_atk != nullptr) && attacker_atk->canRanged &&
-                attacker_atk->currentMode ==
+            if ((attacker_atk != nullptr) && attacker_atk->can_ranged &&
+                attacker_atk->current_mode ==
                     Engine::Core::AttackComponent::CombatMode::Ranged) {
               is_ranged_unit = true;
             }
@@ -234,7 +234,7 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
               auto *movement =
                   attacker->getComponent<Engine::Core::MovementComponent>();
               if (movement != nullptr) {
-                movement->hasTarget = false;
+                movement->has_target = false;
                 movement->vx = 0.0F;
                 movement->vz = 0.0F;
                 movement->path.clear();
@@ -243,8 +243,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
                 if (attacker_transform_component != nullptr) {
                   movement->target_x = attacker_transform_component->position.x;
                   movement->target_y = attacker_transform_component->position.z;
-                  movement->goalX = attacker_transform_component->position.x;
-                  movement->goalY = attacker_transform_component->position.z;
+                  movement->goal_x = attacker_transform_component->position.x;
+                  movement->goal_y = attacker_transform_component->position.z;
                 }
               }
               best_target = target;
@@ -307,7 +307,7 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
 
                 if (movement != nullptr) {
                   if (hold_position) {
-                    movement->hasTarget = false;
+                    movement->has_target = false;
                     movement->vx = 0.0F;
                     movement->vz = 0.0F;
                     movement->path.clear();
@@ -316,9 +316,9 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
                           attacker_transform_component->position.x;
                       movement->target_y =
                           attacker_transform_component->position.z;
-                      movement->goalX =
+                      movement->goal_x =
                           attacker_transform_component->position.x;
-                      movement->goalY =
+                      movement->goal_y =
                           attacker_transform_component->position.z;
                     }
                   } else {
@@ -332,8 +332,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
 
                     float const diff_sq =
                         (planned_target - desired_pos).lengthSquared();
-                    bool need_new_command = !movement->pathPending;
-                    if (movement->hasTarget && diff_sq <= 0.25F * 0.25F) {
+                    bool need_new_command = !movement->path_pending;
+                    if (movement->has_target && diff_sq <= 0.25F * 0.25F) {
                       need_new_command = false;
                     }
 
@@ -412,19 +412,19 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
         auto *new_target =
             attacker->addComponent<Engine::Core::AttackTargetComponent>();
         new_target->target_id = best_target->getId();
-        new_target->shouldChase = false;
+        new_target->should_chase = false;
       } else {
         auto *existing_target =
             attacker->getComponent<Engine::Core::AttackTargetComponent>();
         if (existing_target->target_id != best_target->getId()) {
           existing_target->target_id = best_target->getId();
-          existing_target->shouldChase = false;
+          existing_target->should_chase = false;
         }
       }
 
       bool is_ranged_unit = false;
-      if ((attacker_atk != nullptr) && attacker_atk->canRanged &&
-          attacker_atk->currentMode ==
+      if ((attacker_atk != nullptr) && attacker_atk->can_ranged &&
+          attacker_atk->current_mode ==
               Engine::Core::AttackComponent::CombatMode::Ranged) {
         is_ranged_unit = true;
       }
@@ -432,16 +432,16 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
       if (is_ranged_unit) {
         auto *movement =
             attacker->getComponent<Engine::Core::MovementComponent>();
-        if ((movement != nullptr) && movement->hasTarget) {
-          movement->hasTarget = false;
+        if ((movement != nullptr) && movement->has_target) {
+          movement->has_target = false;
           movement->vx = 0.0F;
           movement->vz = 0.0F;
           movement->path.clear();
           if (attacker_transform != nullptr) {
             movement->target_x = attacker_transform->position.x;
             movement->target_y = attacker_transform->position.z;
-            movement->goalX = attacker_transform->position.x;
-            movement->goalY = attacker_transform->position.z;
+            movement->goal_x = attacker_transform->position.x;
+            movement->goal_y = attacker_transform->position.z;
           }
         }
       }
@@ -454,8 +454,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
           float const dz = tgt_t->position.z - att_t->position.z;
           float const yaw =
               std::atan2(dx, dz) * 180.0F / std::numbers::pi_v<float>;
-          att_t->desiredYaw = yaw;
-          att_t->hasDesiredYaw = true;
+          att_t->desired_yaw = yaw;
+          att_t->has_desired_yaw = true;
         }
       }
 
@@ -467,7 +467,7 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
         auto *att_u = attacker->getComponent<Engine::Core::UnitComponent>();
 
         if ((attacker_atk == nullptr) ||
-            attacker_atk->currentMode !=
+            attacker_atk->current_mode !=
                 Engine::Core::AttackComponent::CombatMode::Melee) {
           QVector3D const a_pos(att_t->position.x, att_t->position.y,
                                 att_t->position.z);
@@ -519,17 +519,17 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
       }
 
       if ((attacker_atk != nullptr) &&
-          attacker_atk->currentMode ==
+          attacker_atk->current_mode ==
               Engine::Core::AttackComponent::CombatMode::Melee) {
 
-        attacker_atk->inMeleeLock = true;
-        attacker_atk->meleeLockTargetId = best_target->getId();
+        attacker_atk->in_melee_lock = true;
+        attacker_atk->melee_lock_target_id = best_target->getId();
 
         auto *target_atk =
             best_target->getComponent<Engine::Core::AttackComponent>();
         if (target_atk != nullptr) {
-          target_atk->inMeleeLock = true;
-          target_atk->meleeLockTargetId = attacker->getId();
+          target_atk->in_melee_lock = true;
+          target_atk->melee_lock_target_id = attacker->getId();
         }
 
         auto *att_t =
@@ -613,10 +613,10 @@ auto CombatSystem::isInRange(Engine::Core::Entity *attacker,
 
   auto *attacker_atk = attacker->getComponent<Engine::Core::AttackComponent>();
   if ((attacker_atk != nullptr) &&
-      attacker_atk->currentMode ==
+      attacker_atk->current_mode ==
           Engine::Core::AttackComponent::CombatMode::Melee) {
     float const height_diff = std::abs(dy);
-    if (height_diff > attacker_atk->max_heightDifference) {
+    if (height_diff > attacker_atk->max_height_difference) {
       return false;
     }
   }
@@ -661,20 +661,20 @@ void CombatSystem::dealDamage(Engine::Core::World *world,
                                       killer_owner_id));
 
       auto *target_atk = target->getComponent<Engine::Core::AttackComponent>();
-      if ((target_atk != nullptr) && target_atk->inMeleeLock &&
-          target_atk->meleeLockTargetId != 0) {
+      if ((target_atk != nullptr) && target_atk->in_melee_lock &&
+          target_atk->melee_lock_target_id != 0) {
 
         if (world != nullptr) {
-          auto *lock_partner = world->getEntity(target_atk->meleeLockTargetId);
+          auto *lock_partner = world->getEntity(target_atk->melee_lock_target_id);
           if ((lock_partner != nullptr) &&
               !lock_partner
                    ->hasComponent<Engine::Core::PendingRemovalComponent>()) {
             auto *partner_atk =
                 lock_partner->getComponent<Engine::Core::AttackComponent>();
             if ((partner_atk != nullptr) &&
-                partner_atk->meleeLockTargetId == target->getId()) {
-              partner_atk->inMeleeLock = false;
-              partner_atk->meleeLockTargetId = 0;
+                partner_atk->melee_lock_target_id == target->getId()) {
+              partner_atk->in_melee_lock = false;
+              partner_atk->melee_lock_target_id = 0;
             }
           }
         }
@@ -691,11 +691,11 @@ void CombatSystem::dealDamage(Engine::Core::World *world,
 
       if (auto *movement =
               target->getComponent<Engine::Core::MovementComponent>()) {
-        movement->hasTarget = false;
+        movement->has_target = false;
         movement->vx = 0.0F;
         movement->vz = 0.0F;
         movement->path.clear();
-        movement->pathPending = false;
+        movement->path_pending = false;
       }
 
       target->addComponent<Engine::Core::PendingRemovalComponent>();
@@ -710,9 +710,9 @@ void CombatSystem::updateCombatMode(
     return;
   }
 
-  if (attack_comp->preferredMode !=
+  if (attack_comp->preferred_mode !=
       Engine::Core::AttackComponent::CombatMode::Auto) {
-    attack_comp->currentMode = attack_comp->preferredMode;
+    attack_comp->current_mode = attack_comp->preferred_mode;
     return;
   }
 
@@ -769,11 +769,11 @@ void CombatSystem::updateCombatMode(
   }
 
   if (closest_enemy_dist_sq == std::numeric_limits<float>::max()) {
-    if (attack_comp->canRanged) {
-      attack_comp->currentMode =
+    if (attack_comp->can_ranged) {
+      attack_comp->current_mode =
           Engine::Core::AttackComponent::CombatMode::Ranged;
     } else {
-      attack_comp->currentMode =
+      attack_comp->current_mode =
           Engine::Core::AttackComponent::CombatMode::Melee;
     }
     return;
@@ -782,19 +782,19 @@ void CombatSystem::updateCombatMode(
   float const closest_dist = std::sqrt(closest_enemy_dist_sq);
 
   bool const in_melee_range =
-      attack_comp->isInMeleeRange(closest_dist, closest_height_diff);
-  bool const in_ranged_range = attack_comp->isInRangedRange(closest_dist);
+      attack_comp->is_in_melee_range(closest_dist, closest_height_diff);
+  bool const in_ranged_range = attack_comp->is_in_ranged_range(closest_dist);
 
-  if (in_melee_range && attack_comp->canMelee) {
-    attack_comp->currentMode = Engine::Core::AttackComponent::CombatMode::Melee;
-  } else if (in_ranged_range && attack_comp->canRanged) {
-    attack_comp->currentMode =
+  if (in_melee_range && attack_comp->can_melee) {
+    attack_comp->current_mode = Engine::Core::AttackComponent::CombatMode::Melee;
+  } else if (in_ranged_range && attack_comp->can_ranged) {
+    attack_comp->current_mode =
         Engine::Core::AttackComponent::CombatMode::Ranged;
-  } else if (attack_comp->canRanged) {
-    attack_comp->currentMode =
+  } else if (attack_comp->can_ranged) {
+    attack_comp->current_mode =
         Engine::Core::AttackComponent::CombatMode::Ranged;
   } else {
-    attack_comp->currentMode = Engine::Core::AttackComponent::CombatMode::Melee;
+    attack_comp->current_mode = Engine::Core::AttackComponent::CombatMode::Melee;
   }
 }
 
@@ -828,12 +828,12 @@ void CombatSystem::processAutoEngagement(Engine::Core::World *world,
     }
 
     auto *attack_comp = unit->getComponent<Engine::Core::AttackComponent>();
-    if ((attack_comp == nullptr) || !attack_comp->canMelee) {
+    if ((attack_comp == nullptr) || !attack_comp->can_melee) {
       continue;
     }
 
-    if (attack_comp->canRanged &&
-        attack_comp->preferredMode !=
+    if (attack_comp->can_ranged &&
+        attack_comp->preferred_mode !=
             Engine::Core::AttackComponent::CombatMode::Melee) {
       continue;
     }
@@ -860,7 +860,7 @@ void CombatSystem::processAutoEngagement(Engine::Core::World *world,
       }
       if (attack_target != nullptr) {
         attack_target->target_id = nearest_enemy->getId();
-        attack_target->shouldChase = true;
+        attack_target->should_chase = true;
 
         m_engagementCooldowns[unit->getId()] = ENGAGEMENT_COOLDOWN;
       }
@@ -882,12 +882,12 @@ auto CombatSystem::isUnitIdle(Engine::Core::Entity *unit) -> bool {
   }
 
   auto *movement = unit->getComponent<Engine::Core::MovementComponent>();
-  if ((movement != nullptr) && movement->hasTarget) {
+  if ((movement != nullptr) && movement->has_target) {
     return false;
   }
 
   auto *attack_comp = unit->getComponent<Engine::Core::AttackComponent>();
-  if ((attack_comp != nullptr) && attack_comp->inMeleeLock) {
+  if ((attack_comp != nullptr) && attack_comp->in_melee_lock) {
     return false;
   }
 

+ 60 - 60
game/systems/command_service.cpp

@@ -135,7 +135,7 @@ void CommandService::moveUnits(Engine::Core::World &world,
     }
 
     auto *atk = e->getComponent<Engine::Core::AttackComponent>();
-    if ((atk != nullptr) && atk->inMeleeLock) {
+    if ((atk != nullptr) && atk->in_melee_lock) {
 
       continue;
     }
@@ -161,7 +161,7 @@ void CommandService::moveUnits(Engine::Core::World &world,
     const float target_z = targets[i].z();
 
     bool matched_pending = false;
-    if (mv->pathPending) {
+    if (mv->path_pending) {
       std::lock_guard<std::mutex> const lock(s_pendingMutex);
       auto request_it = s_entityToRequest.find(units[i]);
       if (request_it != s_entityToRequest.end()) {
@@ -179,32 +179,32 @@ void CommandService::moveUnits(Engine::Core::World &world,
       }
     }
 
-    mv->goalX = target_x;
-    mv->goalY = target_z;
+    mv->goal_x = target_x;
+    mv->goal_y = target_z;
 
     if (matched_pending) {
       continue;
     }
 
     bool should_suppress_path_request = false;
-    if (mv->timeSinceLastPathRequest < pathfinding_request_cooldown) {
+    if (mv->time_since_last_path_request < pathfinding_request_cooldown) {
 
-      float const last_goal_dx = mv->lastGoalX - target_x;
-      float const last_goal_dz = mv->lastGoalY - target_z;
+      float const last_goal_dx = mv->last_goal_x - target_x;
+      float const last_goal_dz = mv->last_goal_y - target_z;
       float const goal_movement_sq =
           last_goal_dx * last_goal_dx + last_goal_dz * last_goal_dz;
 
       if (goal_movement_sq < target_movement_threshold_sq) {
         should_suppress_path_request = true;
 
-        if (mv->hasTarget || mv->pathPending) {
+        if (mv->has_target || mv->path_pending) {
           continue;
         }
       }
     }
 
-    if (!mv->pathPending) {
-      bool const current_target_matches = mv->hasTarget && mv->path.empty();
+    if (!mv->path_pending) {
+      bool const current_target_matches = mv->has_target && mv->path.empty();
       if (current_target_matches) {
         float const dx = mv->target_x - target_x;
         float const dz = mv->target_y - target_z;
@@ -231,10 +231,10 @@ void CommandService::moveUnits(Engine::Core::World &world,
       if (start == end) {
         mv->target_x = target_x;
         mv->target_y = target_z;
-        mv->hasTarget = true;
+        mv->has_target = true;
         mv->path.clear();
-        mv->pathPending = false;
-        mv->pendingRequestId = 0;
+        mv->path_pending = false;
+        mv->pending_request_id = 0;
         mv->vx = 0.0F;
         mv->vz = 0.0F;
         clearPendingRequest(units[i]);
@@ -252,17 +252,17 @@ void CommandService::moveUnits(Engine::Core::World &world,
 
         mv->target_x = target_x;
         mv->target_y = target_z;
-        mv->hasTarget = true;
+        mv->has_target = true;
         mv->path.clear();
-        mv->pathPending = false;
-        mv->pendingRequestId = 0;
+        mv->path_pending = false;
+        mv->pending_request_id = 0;
         mv->vx = 0.0F;
         mv->vz = 0.0F;
         clearPendingRequest(units[i]);
 
-        mv->timeSinceLastPathRequest = 0.0F;
-        mv->lastGoalX = target_x;
-        mv->lastGoalY = target_z;
+        mv->time_since_last_path_request = 0.0F;
+        mv->last_goal_x = target_x;
+        mv->last_goal_y = target_z;
       } else {
 
         bool skip_new_request = false;
@@ -292,14 +292,14 @@ void CommandService::moveUnits(Engine::Core::World &world,
         }
 
         mv->path.clear();
-        mv->hasTarget = false;
+        mv->has_target = false;
         mv->vx = 0.0F;
         mv->vz = 0.0F;
-        mv->pathPending = true;
+        mv->path_pending = true;
 
         std::uint64_t const request_id =
             s_nextRequestId.fetch_add(1, std::memory_order_relaxed);
-        mv->pendingRequestId = request_id;
+        mv->pending_request_id = request_id;
 
         {
           std::lock_guard<std::mutex> const lock(s_pendingMutex);
@@ -310,18 +310,18 @@ void CommandService::moveUnits(Engine::Core::World &world,
 
         s_pathfinder->submitPathRequest(request_id, start, end);
 
-        mv->timeSinceLastPathRequest = 0.0F;
-        mv->lastGoalX = target_x;
-        mv->lastGoalY = target_z;
+        mv->time_since_last_path_request = 0.0F;
+        mv->last_goal_x = target_x;
+        mv->last_goal_y = target_z;
       }
     } else {
 
       mv->target_x = target_x;
       mv->target_y = target_z;
-      mv->hasTarget = true;
+      mv->has_target = true;
       mv->path.clear();
-      mv->pathPending = false;
-      mv->pendingRequestId = 0;
+      mv->path_pending = false;
+      mv->pending_request_id = 0;
       mv->vx = 0.0F;
       mv->vz = 0.0F;
       clearPendingRequest(units[i]);
@@ -599,18 +599,18 @@ void CommandService::moveGroup(Engine::Core::World &world,
   for (auto &member : members) {
     auto *mv = member.movement;
 
-    mv->goalX = member.target.x();
-    mv->goalY = member.target.z();
+    mv->goal_x = member.target.x();
+    mv->goal_y = member.target.z();
 
     clearPendingRequest(member.id);
     mv->target_x = member.transform->position.x;
     mv->target_y = member.transform->position.z;
-    mv->hasTarget = false;
+    mv->has_target = false;
     mv->vx = 0.0F;
     mv->vz = 0.0F;
     mv->path.clear();
-    mv->pathPending = false;
-    mv->pendingRequestId = 0;
+    mv->path_pending = false;
+    mv->pending_request_id = 0;
     units_needing_new_path.push_back(&member);
   }
 
@@ -622,7 +622,7 @@ void CommandService::moveGroup(Engine::Core::World &world,
     for (auto *member : units_needing_new_path) {
       member->movement->target_x = member->target.x();
       member->movement->target_y = member->target.z();
-      member->movement->hasTarget = true;
+      member->movement->has_target = true;
     }
     return;
   }
@@ -635,7 +635,7 @@ void CommandService::moveGroup(Engine::Core::World &world,
     for (auto *member : units_needing_new_path) {
       member->movement->target_x = member->target.x();
       member->movement->target_y = member->target.z();
-      member->movement->hasTarget = true;
+      member->movement->has_target = true;
     }
     return;
   }
@@ -651,11 +651,11 @@ void CommandService::moveGroup(Engine::Core::World &world,
     for (auto *member : units_needing_new_path) {
       member->movement->target_x = member->target.x();
       member->movement->target_y = member->target.z();
-      member->movement->hasTarget = true;
+      member->movement->has_target = true;
 
-      member->movement->timeSinceLastPathRequest = 0.0F;
-      member->movement->lastGoalX = member->target.x();
-      member->movement->lastGoalY = member->target.z();
+      member->movement->time_since_last_path_request = 0.0F;
+      member->movement->last_goal_x = member->target.x();
+      member->movement->last_goal_y = member->target.z();
     }
     return;
   }
@@ -664,12 +664,12 @@ void CommandService::moveGroup(Engine::Core::World &world,
       s_nextRequestId.fetch_add(1, std::memory_order_relaxed);
 
   for (auto *member : units_needing_new_path) {
-    member->movement->pathPending = true;
-    member->movement->pendingRequestId = request_id;
+    member->movement->path_pending = true;
+    member->movement->pending_request_id = request_id;
 
-    member->movement->timeSinceLastPathRequest = 0.0F;
-    member->movement->lastGoalX = member->target.x();
-    member->movement->lastGoalY = member->target.z();
+    member->movement->time_since_last_path_request = 0.0F;
+    member->movement->last_goal_x = member->target.x();
+    member->movement->last_goal_y = member->target.z();
   }
 
   PendingPathRequest pending;
@@ -748,18 +748,18 @@ void CommandService::processPathResults(Engine::Core::World &world) {
         return;
       }
 
-      if (!movement_component->pathPending ||
-          movement_component->pendingRequestId != result.request_id) {
-        movement_component->pathPending = false;
-        movement_component->pendingRequestId = 0;
+      if (!movement_component->path_pending ||
+          movement_component->pending_request_id != result.request_id) {
+        movement_component->path_pending = false;
+        movement_component->pending_request_id = 0;
         return;
       }
 
-      movement_component->pathPending = false;
-      movement_component->pendingRequestId = 0;
+      movement_component->path_pending = false;
+      movement_component->pending_request_id = 0;
       movement_component->path.clear();
-      movement_component->goalX = target.x();
-      movement_component->goalY = target.z();
+      movement_component->goal_x = target.x();
+      movement_component->goal_y = target.z();
       movement_component->vx = 0.0F;
       movement_component->vz = 0.0F;
 
@@ -787,7 +787,7 @@ void CommandService::processPathResults(Engine::Core::World &world) {
           movement_component->target_x = movement_component->path.front().first;
           movement_component->target_y =
               movement_component->path.front().second;
-          movement_component->hasTarget = true;
+          movement_component->has_target = true;
           return;
         }
       }
@@ -795,9 +795,9 @@ void CommandService::processPathResults(Engine::Core::World &world) {
       if (request_info.options.allowDirectFallback) {
         movement_component->target_x = target.x();
         movement_component->target_y = target.z();
-        movement_component->hasTarget = true;
+        movement_component->has_target = true;
       } else {
-        movement_component->hasTarget = false;
+        movement_component->has_target = false;
       }
     };
 
@@ -876,7 +876,7 @@ void CommandService::attack_target(
     }
 
     attack_target->target_id = target_id;
-    attack_target->shouldChase = shouldChase;
+    attack_target->should_chase = shouldChase;
 
     if (!shouldChase) {
       continue;
@@ -904,7 +904,7 @@ void CommandService::attack_target(
     bool is_ranged_unit = false;
     if (auto *atk = e->getComponent<Engine::Core::AttackComponent>()) {
       range = std::max(0.1F, atk->range);
-      if (atk->canRanged && atk->range > atk->meleeRange * 1.5F) {
+      if (atk->can_ranged && atk->range > atk->melee_range * 1.5F) {
         is_ranged_unit = true;
       }
     }
@@ -948,9 +948,9 @@ void CommandService::attack_target(
 
       mv->target_x = desired_pos.x();
       mv->target_y = desired_pos.z();
-      mv->goalX = desired_pos.x();
-      mv->goalY = desired_pos.z();
-      mv->hasTarget = true;
+      mv->goal_x = desired_pos.x();
+      mv->goal_y = desired_pos.z();
+      mv->has_target = true;
       mv->path.clear();
     }
   }

+ 33 - 33
game/systems/movement_system.cpp

@@ -119,11 +119,11 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
     }
 
     if (hold_mode->active) {
-      movement->hasTarget = false;
+      movement->has_target = false;
       movement->vx = 0.0F;
       movement->vz = 0.0F;
       movement->path.clear();
-      movement->pathPending = false;
+      movement->path_pending = false;
       in_hold_mode = true;
     }
 
@@ -137,9 +137,9 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
 
   if (in_hold_mode) {
     if (!entity->hasComponent<Engine::Core::BuildingComponent>()) {
-      if (transform->hasDesiredYaw) {
+      if (transform->has_desired_yaw) {
         float const current = transform->rotation.y;
-        float const target_yaw = transform->desiredYaw;
+        float const target_yaw = transform->desired_yaw;
         float const diff =
             std::fmod((target_yaw - current + 540.0F), 360.0F) - 180.0F;
         float const turn_speed = 180.0F;
@@ -148,7 +148,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
         transform->rotation.y = current + step;
 
         if (std::fabs(diff) < 0.5F) {
-          transform->hasDesiredYaw = false;
+          transform->has_desired_yaw = false;
         }
       }
     }
@@ -156,50 +156,50 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
   }
 
   auto *atk = entity->getComponent<Engine::Core::AttackComponent>();
-  if ((atk != nullptr) && atk->inMeleeLock) {
+  if ((atk != nullptr) && atk->in_melee_lock) {
 
-    movement->hasTarget = false;
+    movement->has_target = false;
     movement->vx = 0.0F;
     movement->vz = 0.0F;
     movement->path.clear();
-    movement->pathPending = false;
+    movement->path_pending = false;
     return;
   }
 
-  QVector3D const final_goal(movement->goalX, 0.0F, movement->goalY);
+  QVector3D const final_goal(movement->goal_x, 0.0F, movement->goal_y);
   bool const destination_allowed = isPointAllowed(final_goal, entity->getId());
 
-  if (movement->hasTarget && !destination_allowed) {
+  if (movement->has_target && !destination_allowed) {
     movement->path.clear();
-    movement->hasTarget = false;
-    movement->pathPending = false;
-    movement->pendingRequestId = 0;
+    movement->has_target = false;
+    movement->path_pending = false;
+    movement->pending_request_id = 0;
     movement->vx = 0.0F;
     movement->vz = 0.0F;
     return;
   }
 
-  if (movement->repathCooldown > 0.0F) {
-    movement->repathCooldown =
-        std::max(0.0F, movement->repathCooldown - deltaTime);
+  if (movement->repath_cooldown > 0.0F) {
+    movement->repath_cooldown =
+        std::max(0.0F, movement->repath_cooldown - deltaTime);
   }
 
-  if (movement->timeSinceLastPathRequest < 10.0F) {
-    movement->timeSinceLastPathRequest += deltaTime;
+  if (movement->time_since_last_path_request < 10.0F) {
+    movement->time_since_last_path_request += deltaTime;
   }
 
   const float max_speed = std::max(0.1F, unit->speed);
   const float accel = max_speed * 4.0F;
   const float damping = 6.0F;
 
-  if (!movement->hasTarget) {
+  if (!movement->has_target) {
     QVector3D const current_pos(transform->position.x, 0.0F,
                                 transform->position.z);
     float const goal_dist_sq = (final_goal - current_pos).lengthSquared();
     constexpr float k_stuck_distance_sq = 0.6F * 0.6F;
 
     bool requested_recovery_move = false;
-    if (!movement->pathPending && movement->repathCooldown <= 0.0F &&
+    if (!movement->path_pending && movement->repath_cooldown <= 0.0F &&
         goal_dist_sq > k_stuck_distance_sq && std::isfinite(goal_dist_sq) &&
         destination_allowed) {
       CommandService::MoveOptions opts;
@@ -208,7 +208,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
       std::vector<Engine::Core::EntityID> const ids = {entity->getId()};
       std::vector<QVector3D> const targets = {final_goal};
       CommandService::moveUnits(*world, ids, targets, opts);
-      movement->repathCooldown = repath_cooldown_seconds;
+      movement->repath_cooldown = repath_cooldown_seconds;
       requested_recovery_move = true;
     }
 
@@ -262,7 +262,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
 
       } else {
         bool issued_path_request = false;
-        if (!movement->pathPending && movement->repathCooldown <= 0.0F) {
+        if (!movement->path_pending && movement->repath_cooldown <= 0.0F) {
           float const goal_dist_sq = (final_goal - current_pos).lengthSquared();
           if (goal_dist_sq > 0.01F && destination_allowed) {
             CommandService::MoveOptions opts;
@@ -270,20 +270,20 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
             opts.allowDirectFallback = false;
             std::vector<Engine::Core::EntityID> const ids = {entity->getId()};
             std::vector<QVector3D> const targets = {
-                QVector3D(movement->goalX, 0.0F, movement->goalY)};
+                QVector3D(movement->goal_x, 0.0F, movement->goal_y)};
             CommandService::moveUnits(*world, ids, targets, opts);
-            movement->repathCooldown = repath_cooldown_seconds;
+            movement->repath_cooldown = repath_cooldown_seconds;
             issued_path_request = true;
           }
         }
 
         if (!issued_path_request) {
-          movement->pathPending = false;
-          movement->pendingRequestId = 0;
+          movement->path_pending = false;
+          movement->pending_request_id = 0;
         }
 
         movement->path.clear();
-        movement->hasTarget = false;
+        movement->has_target = false;
         movement->vx = 0.0F;
         movement->vz = 0.0F;
         return;
@@ -299,7 +299,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
     float dist2 = dx * dx + dz * dz;
 
     int safety_counter = max_waypoint_skip_count;
-    while (movement->hasTarget && dist2 < arrive_radius_sq &&
+    while (movement->has_target && dist2 < arrive_radius_sq &&
            safety_counter-- > 0) {
       if (!movement->path.empty()) {
         movement->path.erase(movement->path.begin());
@@ -315,12 +315,12 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
 
       transform->position.x = movement->target_x;
       transform->position.z = movement->target_y;
-      movement->hasTarget = false;
+      movement->has_target = false;
       movement->vx = movement->vz = 0.0F;
       break;
     }
 
-    if (!movement->hasTarget) {
+    if (!movement->has_target) {
       movement->vx *= std::max(0.0F, 1.0F - damping * deltaTime);
       movement->vz *= std::max(0.0F, 1.0F - damping * deltaTime);
     } else {
@@ -383,10 +383,10 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
       float const step =
           std::clamp(diff, -turn_speed * deltaTime, turn_speed * deltaTime);
       transform->rotation.y = current + step;
-    } else if (transform->hasDesiredYaw) {
+    } else if (transform->has_desired_yaw) {
 
       float const current = transform->rotation.y;
-      float const target_yaw = transform->desiredYaw;
+      float const target_yaw = transform->desired_yaw;
       float const diff =
           std::fmod((target_yaw - current + 540.0F), 360.0F) - 180.0F;
       float const turn_speed = 180.0F;
@@ -395,7 +395,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
       transform->rotation.y = current + step;
 
       if (std::fabs(diff) < 0.5F) {
-        transform->hasDesiredYaw = false;
+        transform->has_desired_yaw = false;
       }
     }
   }

+ 1 - 1
game/systems/nation_loader.cpp

@@ -143,7 +143,7 @@ static auto nation_loader_logger() -> QLoggingCategory & { return logger(); }
                             base_class.production.is_melee);
   const QJsonObject production = ensure_object(obj.value("production"));
   entry.cost = production.value("cost").toInt(base_class.production.cost);
-  entry.buildTime =
+  entry.build_time =
       static_cast<float>(production.value("build_time")
                              .toDouble(base_class.production.build_time));
   entry.priority =

+ 1 - 1
game/systems/nation_registry.cpp

@@ -152,7 +152,7 @@ void NationRegistry::initializeDefaults() {
       troop_entry.displayName = troop_class.display_name;
       troop_entry.isMelee = troop_class.production.is_melee;
       troop_entry.cost = troop_class.production.cost;
-      troop_entry.buildTime = troop_class.production.build_time;
+      troop_entry.build_time = troop_class.production.build_time;
       troop_entry.priority = troop_class.production.priority;
 
       roman.availableTroops.push_back(std::move(troop_entry));

+ 8 - 8
game/systems/patrol_system.cpp

@@ -68,7 +68,7 @@ void PatrolSystem::update(Engine::Core::World *world, float) {
         }
         if (attack_target != nullptr) {
           attack_target->target_id = other->getId();
-          attack_target->shouldChase = false;
+          attack_target->should_chase = false;
         }
         break;
       }
@@ -79,7 +79,7 @@ void PatrolSystem::update(Engine::Core::World *world, float) {
       continue;
     }
 
-    auto waypoint = patrol->waypoints[patrol->currentWaypoint];
+    auto waypoint = patrol->waypoints[patrol->current_waypoint];
     float target_x = waypoint.first;
     float target_z = waypoint.second;
 
@@ -89,18 +89,18 @@ void PatrolSystem::update(Engine::Core::World *world, float) {
 
     if (dist_sq < 1.0F) {
 
-      patrol->currentWaypoint =
-          (patrol->currentWaypoint + 1) % patrol->waypoints.size();
-      waypoint = patrol->waypoints[patrol->currentWaypoint];
+      patrol->current_waypoint =
+          (patrol->current_waypoint + 1) % patrol->waypoints.size();
+      waypoint = patrol->waypoints[patrol->current_waypoint];
       target_x = waypoint.first;
       target_z = waypoint.second;
     }
 
-    movement->hasTarget = true;
+    movement->has_target = true;
     movement->target_x = target_x;
     movement->target_y = target_z;
-    movement->goalX = target_x;
-    movement->goalY = target_z;
+    movement->goal_x = target_x;
+    movement->goal_y = target_z;
   }
 }
 

+ 20 - 20
game/systems/production_service.cpp

@@ -49,8 +49,8 @@ void apply_production_profile(Engine::Core::ProductionComponent *prod,
   }
   const auto profile =
       TroopProfileService::instance().get_profile(nation_id, unit_type);
-  prod->buildTime = profile.production.build_time;
-  prod->villagerCost = profile.individuals_per_unit;
+  prod->build_time = profile.production.build_time;
+  prod->villager_cost = profile.individuals_per_unit;
 }
 
 } // namespace
@@ -78,7 +78,7 @@ auto ProductionService::startProductionForFirstSelectedBarracks(
 
   int const individuals_per_unit = profile.individuals_per_unit;
 
-  if (p->producedCount + individuals_per_unit > p->maxUnits) {
+  if (p->produced_count + individuals_per_unit > p->max_units) {
     return ProductionResult::PerBarracksLimitReached;
   }
 
@@ -90,20 +90,20 @@ auto ProductionService::startProductionForFirstSelectedBarracks(
   }
 
   const int max_queue_size = 5;
-  int total_in_queue = p->inProgress ? 1 : 0;
-  total_in_queue += static_cast<int>(p->productionQueue.size());
+  int total_in_queue = p->in_progress ? 1 : 0;
+  total_in_queue += static_cast<int>(p->production_queue.size());
 
   if (total_in_queue >= max_queue_size) {
     return ProductionResult::QueueFull;
   }
 
-  if (p->inProgress) {
-    p->productionQueue.push_back(unit_type);
+  if (p->in_progress) {
+    p->production_queue.push_back(unit_type);
   } else {
     p->product_type = unit_type;
     apply_production_profile(p, nation_id, unit_type);
-    p->timeRemaining = p->buildTime;
-    p->inProgress = true;
+    p->time_remaining = p->build_time;
+    p->in_progress = true;
   }
 
   return ProductionResult::Success;
@@ -124,9 +124,9 @@ auto ProductionService::setRallyForFirstSelectedBarracks(
   if (p == nullptr) {
     return false;
   }
-  p->rallyX = x;
-  p->rallyZ = z;
-  p->rallySet = true;
+  p->rally_x = x;
+  p->rally_z = z;
+  p->rally_set = true;
   return true;
 }
 
@@ -146,15 +146,15 @@ auto ProductionService::getSelectedBarracksState(
     outState.nation_id = NationRegistry::instance().default_nation_id();
   }
   if (auto *p = e->getComponent<Engine::Core::ProductionComponent>()) {
-    outState.inProgress = p->inProgress;
+    outState.in_progress = p->in_progress;
     outState.product_type = p->product_type;
-    outState.timeRemaining = p->timeRemaining;
-    outState.buildTime = p->buildTime;
-    outState.producedCount = p->producedCount;
-    outState.maxUnits = p->maxUnits;
-    outState.villagerCost = p->villagerCost;
-    outState.queueSize = static_cast<int>(p->productionQueue.size());
-    outState.productionQueue = p->productionQueue;
+    outState.time_remaining = p->time_remaining;
+    outState.build_time = p->build_time;
+    outState.produced_count = p->produced_count;
+    outState.max_units = p->max_units;
+    outState.villager_cost = p->villager_cost;
+    outState.queueSize = static_cast<int>(p->production_queue.size());
+    outState.production_queue = p->production_queue;
   }
   return true;
 }

+ 21 - 21
game/systems/production_system.cpp

@@ -25,8 +25,8 @@ void apply_production_profile(Engine::Core::ProductionComponent *prod,
   }
   const auto profile =
       TroopProfileService::instance().get_profile(nation_id, troop_type);
-  prod->buildTime = profile.production.build_time;
-  prod->villagerCost = profile.individuals_per_unit;
+  prod->build_time = profile.production.build_time;
+  prod->villager_cost = profile.individuals_per_unit;
 }
 
 auto resolve_nation_id(const Engine::Core::UnitComponent *unit,
@@ -57,7 +57,7 @@ void ProductionSystem::update(Engine::Core::World *world, float deltaTime) {
       continue;
     }
 
-    if (!prod->inProgress) {
+    if (!prod->in_progress) {
       continue;
     }
 
@@ -67,12 +67,12 @@ void ProductionSystem::update(Engine::Core::World *world, float deltaTime) {
         nation_id, prod->product_type);
     int const individuals_per_unit = current_profile.individuals_per_unit;
 
-    if (prod->producedCount + individuals_per_unit > prod->maxUnits) {
-      prod->inProgress = false;
+    if (prod->produced_count + individuals_per_unit > prod->max_units) {
+      prod->in_progress = false;
       continue;
     }
-    prod->timeRemaining -= deltaTime;
-    if (prod->timeRemaining <= 0.0F) {
+    prod->time_remaining -= deltaTime;
+    if (prod->time_remaining <= 0.0F) {
 
       auto *t = e->getComponent<Engine::Core::TransformComponent>();
       auto *u = e->getComponent<Engine::Core::UnitComponent>();
@@ -83,13 +83,13 @@ void ProductionSystem::update(Engine::Core::World *world, float deltaTime) {
         int const max_troops =
             Game::GameConfig::instance().getMaxTroopsPerPlayer();
         if (current_troops + individuals_per_unit > max_troops) {
-          prod->inProgress = false;
-          prod->timeRemaining = 0.0F;
+          prod->in_progress = false;
+          prod->time_remaining = 0.0F;
           continue;
         }
 
-        float const exit_offset = 2.5F + 0.2F * float(prod->producedCount % 5);
-        float const exit_angle = 0.5F * float(prod->producedCount % 8);
+        float const exit_offset = 2.5F + 0.2F * float(prod->produced_count % 5);
+        float const exit_angle = 0.5F * float(prod->produced_count % 8);
         QVector3D const exit_pos =
             QVector3D(t->position.x + exit_offset * std::cos(exit_angle), 0.0F,
                       t->position.z + exit_offset * std::sin(exit_angle));
@@ -106,23 +106,23 @@ void ProductionSystem::update(Engine::Core::World *world, float deltaTime) {
           sp.nation_id = nation_id;
           auto unit = reg->create(sp.spawn_type, *world, sp);
 
-          if (unit && prod->rallySet) {
-            unit->moveTo(prod->rallyX, prod->rallyZ);
+          if (unit && prod->rally_set) {
+            unit->moveTo(prod->rally_x, prod->rally_z);
           }
         }
 
-        prod->producedCount += individuals_per_unit;
+        prod->produced_count += individuals_per_unit;
       }
 
-      prod->inProgress = false;
-      prod->timeRemaining = 0.0F;
+      prod->in_progress = false;
+      prod->time_remaining = 0.0F;
 
-      if (!prod->productionQueue.empty()) {
-        prod->product_type = prod->productionQueue.front();
-        prod->productionQueue.erase(prod->productionQueue.begin());
+      if (!prod->production_queue.empty()) {
+        prod->product_type = prod->production_queue.front();
+        prod->production_queue.erase(prod->production_queue.begin());
         apply_production_profile(prod, nation_id, prod->product_type);
-        prod->timeRemaining = prod->buildTime;
-        prod->inProgress = true;
+        prod->time_remaining = prod->build_time;
+        prod->in_progress = true;
       }
     }
   }

+ 42 - 42
game/systems/selection_system.cpp

@@ -17,30 +17,30 @@
 
 namespace Game::Systems {
 
-void SelectionSystem::update(Engine::Core::World *world, float deltaTime) {}
+void SelectionSystem::update(Engine::Core::World *world, float delta_time) {}
 
-void SelectionSystem::selectUnit(Engine::Core::EntityID unit_id) {
-  auto it = std::find(m_selectedUnits.begin(), m_selectedUnits.end(), unit_id);
-  if (it == m_selectedUnits.end()) {
-    m_selectedUnits.push_back(unit_id);
+void SelectionSystem::select_unit(Engine::Core::EntityID unit_id) {
+  auto it = std::find(m_selected_units.begin(), m_selected_units.end(), unit_id);
+  if (it == m_selected_units.end()) {
+    m_selected_units.push_back(unit_id);
     Engine::Core::EventManager::instance().publish(
         Engine::Core::UnitSelectedEvent(unit_id));
   }
 }
 
-void SelectionSystem::deselectUnit(Engine::Core::EntityID unit_id) {
-  auto it = std::find(m_selectedUnits.begin(), m_selectedUnits.end(), unit_id);
-  if (it != m_selectedUnits.end()) {
-    m_selectedUnits.erase(it);
+void SelectionSystem::deselect_unit(Engine::Core::EntityID unit_id) {
+  auto it = std::find(m_selected_units.begin(), m_selected_units.end(), unit_id);
+  if (it != m_selected_units.end()) {
+    m_selected_units.erase(it);
   }
 }
 
-void SelectionSystem::clearSelection() { m_selectedUnits.clear(); }
+void SelectionSystem::clear_selection() { m_selected_units.clear(); }
 
-void SelectionSystem::selectUnitsInArea(float x1, float y1, float x2,
+void SelectionSystem::select_unitsInArea(float x1, float y1, float x2,
                                         float y2) {}
 
-auto SelectionSystem::isUnitInArea(Engine::Core::Entity *entity, float x1,
+auto SelectionSystem::is_unit_in_area(Engine::Core::Entity *entity, float x1,
                                    float y1, float x2, float y2) -> bool {
   auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
   if (transform == nullptr) {
@@ -59,12 +59,12 @@ SelectionController::SelectionController(Engine::Core::World *world,
                                          PickingService *pickingService,
                                          QObject *parent)
     : QObject(parent), m_world(world), m_selection_system(selection_system),
-      m_pickingService(pickingService) {}
+      m_picking_service(pickingService) {}
 
-void SelectionController::onClickSelect(qreal sx, qreal sy, bool additive,
-                                        int viewportWidth, int viewportHeight,
-                                        void *camera, int localOwnerId) {
-  if ((m_selection_system == nullptr) || (m_pickingService == nullptr) ||
+void SelectionController::on_click_select(qreal sx, qreal sy, bool additive,
+                                        int viewport_width, int viewport_height,
+                                        void *camera, int local_owner_id) {
+  if ((m_selection_system == nullptr) || (m_picking_service == nullptr) ||
       (camera == nullptr) || (m_world == nullptr)) {
     return;
   }
@@ -72,8 +72,8 @@ void SelectionController::onClickSelect(qreal sx, qreal sy, bool additive,
   auto *cam = static_cast<Render::GL::Camera *>(camera);
   Engine::Core::EntityID const picked =
       Game::Systems::PickingService::pickSingle(
-          float(sx), float(sy), *m_world, *cam, viewportWidth, viewportHeight,
-          localOwnerId, true);
+          float(sx), float(sy), *m_world, *cam, viewport_width, viewport_height,
+          local_owner_id, true);
 
   if (picked != 0U) {
 
@@ -82,22 +82,22 @@ void SelectionController::onClickSelect(qreal sx, qreal sy, bool additive,
     }
     m_selection_system->selectUnit(picked);
     syncSelectionFlags();
-    emit selectionChanged();
+    emit selection_changed();
     return;
   }
 
   if (!additive && !m_selection_system->getSelectedUnits().empty()) {
     m_selection_system->clearSelection();
     syncSelectionFlags();
-    emit selectionChanged();
+    emit selection_changed();
   }
 }
 
-void SelectionController::onAreaSelected(qreal x1, qreal y1, qreal x2, qreal y2,
-                                         bool additive, int viewportWidth,
-                                         int viewportHeight, void *camera,
-                                         int localOwnerId) {
-  if ((m_selection_system == nullptr) || (m_pickingService == nullptr) ||
+void SelectionController::on_area_selected(qreal x1, qreal y1, qreal x2, qreal y2,
+                                         bool additive, int viewport_width,
+                                         int viewport_height, void *camera,
+                                         int local_owner_id) {
+  if ((m_selection_system == nullptr) || (m_picking_service == nullptr) ||
       (camera == nullptr) || (m_world == nullptr)) {
     return;
   }
@@ -108,25 +108,25 @@ void SelectionController::onAreaSelected(qreal x1, qreal y1, qreal x2, qreal y2,
 
   auto *cam = static_cast<Render::GL::Camera *>(camera);
   auto picked = Game::Systems::PickingService::pickInRect(
-      float(x1), float(y1), float(x2), float(y2), *m_world, *cam, viewportWidth,
-      viewportHeight, localOwnerId);
+      float(x1), float(y1), float(x2), float(y2), *m_world, *cam, viewport_width,
+      viewport_height, local_owner_id);
   for (auto id : picked) {
     m_selection_system->selectUnit(id);
   }
   syncSelectionFlags();
-  emit selectionChanged();
+  emit selection_changed();
 }
 
-void SelectionController::onRightClickClearSelection() {
+void SelectionController::on_right_click_clear_selection() {
   if (m_selection_system == nullptr) {
     return;
   }
   m_selection_system->clearSelection();
   syncSelectionFlags();
-  emit selectionChanged();
+  emit selection_changed();
 }
 
-void SelectionController::selectAllPlayerTroops(int localOwnerId) {
+void SelectionController::select_all_player_troops(int local_owner_id) {
   if ((m_selection_system == nullptr) || (m_world == nullptr)) {
     return;
   }
@@ -136,7 +136,7 @@ void SelectionController::selectAllPlayerTroops(int localOwnerId) {
   auto entities = m_world->getEntitiesWith<Engine::Core::UnitComponent>();
   for (auto *e : entities) {
     auto *unit = e->getComponent<Engine::Core::UnitComponent>();
-    if ((unit == nullptr) || unit->owner_id != localOwnerId) {
+    if ((unit == nullptr) || unit->owner_id != local_owner_id) {
       continue;
     }
 
@@ -152,11 +152,11 @@ void SelectionController::selectAllPlayerTroops(int localOwnerId) {
   }
 
   syncSelectionFlags();
-  emit selectionChanged();
+  emit selection_changed();
 }
 
-void SelectionController::selectSingleUnit(Engine::Core::EntityID id,
-                                           int localOwnerId) {
+void SelectionController::select_single_unit(Engine::Core::EntityID id,
+                                           int local_owner_id) {
   if ((m_selection_system == nullptr) || (m_world == nullptr)) {
     return;
   }
@@ -168,17 +168,17 @@ void SelectionController::selectSingleUnit(Engine::Core::EntityID id,
 
   auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
   if ((unit == nullptr) || (unit->health <= 0) ||
-      (unit->owner_id != localOwnerId)) {
+      (unit->owner_id != local_owner_id)) {
     return;
   }
 
   m_selection_system->clearSelection();
   m_selection_system->selectUnit(id);
   syncSelectionFlags();
-  emit selectionChanged();
+  emit selection_changed();
 }
 
-auto SelectionController::hasUnitsSelected() const -> bool {
+auto SelectionController::has_units_selected() const -> bool {
   if (m_selection_system == nullptr) {
     return false;
   }
@@ -186,7 +186,7 @@ auto SelectionController::hasUnitsSelected() const -> bool {
   return !sel.empty();
 }
 
-void SelectionController::getSelectedUnitIds(
+void SelectionController::get_selected_unit_ids(
     std::vector<Engine::Core::EntityID> &out) const {
   out.clear();
   if (m_selection_system == nullptr) {
@@ -196,7 +196,7 @@ void SelectionController::getSelectedUnitIds(
   out.assign(ids.begin(), ids.end());
 }
 
-auto SelectionController::hasSelectedType(const QString &type) const -> bool {
+auto SelectionController::has_selected_type(const QString &type) const -> bool {
   if ((m_world == nullptr) || (m_selection_system == nullptr)) {
     return false;
   }
@@ -214,7 +214,7 @@ auto SelectionController::hasSelectedType(const QString &type) const -> bool {
   return false;
 }
 
-void SelectionController::syncSelectionFlags() {
+void SelectionController::sync_selection_flags() {
   if ((m_world == nullptr) || (m_selection_system == nullptr)) {
     return;
   }

+ 25 - 25
game/systems/selection_system.h

@@ -17,21 +17,21 @@ class PickingService;
 
 class SelectionSystem : public Engine::Core::System {
 public:
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 
-  void selectUnit(Engine::Core::EntityID unit_id);
-  void deselectUnit(Engine::Core::EntityID unit_id);
-  void clearSelection();
-  void selectUnitsInArea(float x1, float y1, float x2, float y2);
+  void select_unit(Engine::Core::EntityID unit_id);
+  void deselect_unit(Engine::Core::EntityID unit_id);
+  void clear_selection();
+  void select_units_in_area(float x1, float y1, float x2, float y2);
 
   [[nodiscard]] auto
-  getSelectedUnits() const -> const std::vector<Engine::Core::EntityID> & {
-    return m_selectedUnits;
+  get_selected_units() const -> const std::vector<Engine::Core::EntityID> & {
+    return m_selected_units;
   }
 
 private:
-  std::vector<Engine::Core::EntityID> m_selectedUnits;
-  static auto isUnitInArea(Engine::Core::Entity *entity, float x1, float y1,
+  std::vector<Engine::Core::EntityID> m_selected_units;
+  static auto is_unit_in_area(Engine::Core::Entity *entity, float x1, float y1,
                            float x2, float y2) -> bool;
 };
 
@@ -40,32 +40,32 @@ class SelectionController : public QObject {
 public:
   SelectionController(Engine::Core::World *world,
                       SelectionSystem *selection_system,
-                      PickingService *pickingService,
+                      PickingService *picking_service,
                       QObject *parent = nullptr);
 
-  void onClickSelect(qreal sx, qreal sy, bool additive, int viewportWidth,
-                     int viewportHeight, void *camera, int localOwnerId);
-  void onAreaSelected(qreal x1, qreal y1, qreal x2, qreal y2, bool additive,
-                      int viewportWidth, int viewportHeight, void *camera,
-                      int localOwnerId);
-  void onRightClickClearSelection();
-  void selectAllPlayerTroops(int localOwnerId);
-  void selectSingleUnit(Engine::Core::EntityID id, int localOwnerId);
+  void on_click_select(qreal sx, qreal sy, bool additive, int viewport_width,
+                     int viewport_height, void *camera, int local_owner_id);
+  void on_area_selected(qreal x1, qreal y1, qreal x2, qreal y2, bool additive,
+                      int viewport_width, int viewport_height, void *camera,
+                      int local_owner_id);
+  void on_right_click_clear_selection();
+  void select_all_player_troops(int local_owner_id);
+  void select_single_unit(Engine::Core::EntityID id, int local_owner_id);
 
-  [[nodiscard]] auto hasUnitsSelected() const -> bool;
-  void getSelectedUnitIds(std::vector<Engine::Core::EntityID> &out) const;
-  [[nodiscard]] auto hasSelectedType(const QString &type) const -> bool;
+  [[nodiscard]] auto has_units_selected() const -> bool;
+  void get_selected_unit_ids(std::vector<Engine::Core::EntityID> &out) const;
+  [[nodiscard]] auto has_selected_type(const QString &type) const -> bool;
 
 signals:
-  void selectionChanged();
-  void selectionModelRefreshRequested();
+  void selection_changed();
+  void selection_model_refresh_requested();
 
 private:
   Engine::Core::World *m_world;
   SelectionSystem *m_selection_system;
-  PickingService *m_pickingService;
+  PickingService *m_picking_service;
 
-  void syncSelectionFlags();
+  void sync_selection_flags();
 };
 
 } // namespace Game::Systems

+ 1 - 1
game/systems/troop_profile_service.cpp

@@ -65,7 +65,7 @@ auto TroopProfileService::build_profile(
   if (const auto *nationTroop = nation.getTroop(type)) {
     profile.display_name = nationTroop->displayName;
     profile.production.cost = nationTroop->cost;
-    profile.production.build_time = nationTroop->buildTime;
+    profile.production.build_time = nationTroop->build_time;
     profile.production.priority = nationTroop->priority;
     profile.production.is_melee = nationTroop->isMelee;
   }

+ 11 - 11
game/units/archer.cpp

@@ -51,7 +51,7 @@ void Archer::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -74,8 +74,8 @@ void Archer::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -86,19 +86,19 @@ void Archer::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Auto
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
-  m_atk->max_heightDifference = 2.0F;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
+  m_atk->max_height_difference = 2.0F;
 
   Engine::Core::EventManager::instance().publish(
       Engine::Core::UnitSpawnedEvent(m_id, m_u->owner_id, m_u->spawn_type));

+ 10 - 10
game/units/ballista.cpp

@@ -52,7 +52,7 @@ void Ballista::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -74,8 +74,8 @@ void Ballista::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -86,18 +86,18 @@ void Ballista::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Ranged
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
 }
 
 } // namespace Game::Units

+ 10 - 10
game/units/barracks.cpp

@@ -64,20 +64,20 @@ void Barracks::init(const SpawnParams &params) {
   if (!Game::Core::isNeutralOwner(m_u->owner_id)) {
     if (auto *prod = e->addComponent<Engine::Core::ProductionComponent>()) {
       prod->product_type = TroopType::Archer;
-      prod->buildTime = 10.0F;
-      prod->maxUnits = params.maxPopulation;
-      prod->inProgress = false;
-      prod->timeRemaining = 0.0F;
-      prod->producedCount = 0;
-      prod->rallyX = m_t->position.x + 4.0F;
-      prod->rallyZ = m_t->position.z + 2.0F;
-      prod->rallySet = true;
+      prod->build_time = 10.0F;
+      prod->max_units = params.maxPopulation;
+      prod->in_progress = false;
+      prod->time_remaining = 0.0F;
+      prod->produced_count = 0;
+      prod->rally_x = m_t->position.x + 4.0F;
+      prod->rally_z = m_t->position.z + 2.0F;
+      prod->rally_set = true;
 
       const auto profile =
           Game::Systems::TroopProfileService::instance().get_profile(
               nation_id, prod->product_type);
-      prod->buildTime = profile.production.build_time;
-      prod->villagerCost = profile.individuals_per_unit;
+      prod->build_time = profile.production.build_time;
+      prod->villager_cost = profile.individuals_per_unit;
     }
   }
 

+ 11 - 11
game/units/catapult.cpp

@@ -52,7 +52,7 @@ void Catapult::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -74,8 +74,8 @@ void Catapult::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -86,19 +86,19 @@ void Catapult::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Ranged
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
-  m_atk->max_heightDifference = 5.0F;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
+  m_atk->max_height_difference = 5.0F;
 
   Engine::Core::EventManager::instance().publish(
       Engine::Core::UnitSpawnedEvent(m_id, m_u->owner_id, m_u->spawn_type));

+ 3 - 3
game/units/healer.cpp

@@ -51,7 +51,7 @@ void Healer::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -73,8 +73,8 @@ void Healer::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }

+ 11 - 11
game/units/horse_archer.cpp

@@ -52,7 +52,7 @@ void HorseArcher::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -75,8 +75,8 @@ void HorseArcher::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -87,19 +87,19 @@ void HorseArcher::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Auto
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
-  m_atk->max_heightDifference = 2.0F;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
+  m_atk->max_height_difference = 2.0F;
 
   Engine::Core::EventManager::instance().publish(
       Engine::Core::UnitSpawnedEvent(m_id, m_u->owner_id, m_u->spawn_type));

+ 11 - 11
game/units/horse_spearman.cpp

@@ -53,7 +53,7 @@ void HorseSpearman::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -76,8 +76,8 @@ void HorseSpearman::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -88,19 +88,19 @@ void HorseSpearman::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Auto
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
-  m_atk->max_heightDifference = 2.0F;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
+  m_atk->max_height_difference = 2.0F;
 
   Engine::Core::EventManager::instance().publish(
       Engine::Core::UnitSpawnedEvent(m_id, m_u->owner_id, m_u->spawn_type));

+ 11 - 11
game/units/horse_swordsman.cpp

@@ -53,7 +53,7 @@ void MountedKnight::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -76,8 +76,8 @@ void MountedKnight::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -88,19 +88,19 @@ void MountedKnight::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Auto
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
-  m_atk->max_heightDifference = 2.0F;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
+  m_atk->max_height_difference = 2.0F;
 
   Engine::Core::EventManager::instance().publish(
       Engine::Core::UnitSpawnedEvent(m_id, m_u->owner_id, m_u->spawn_type));

+ 11 - 11
game/units/spearman.cpp

@@ -52,7 +52,7 @@ void Spearman::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -75,8 +75,8 @@ void Spearman::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -87,19 +87,19 @@ void Spearman::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Auto
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
-  m_atk->max_heightDifference = 2.0F;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
+  m_atk->max_height_difference = 2.0F;
 
   Engine::Core::EventManager::instance().publish(
       Engine::Core::UnitSpawnedEvent(m_id, m_u->owner_id, m_u->spawn_type));

+ 11 - 11
game/units/swordsman.cpp

@@ -52,7 +52,7 @@ void Swordsman::init(const SpawnParams &params) {
 
   m_r = e->addComponent<Engine::Core::RenderableComponent>("", "");
   m_r->visible = true;
-  m_r->rendererId = profile.visuals.renderer_id;
+  m_r->renderer_id = profile.visuals.renderer_id;
 
   m_u = e->addComponent<Engine::Core::UnitComponent>();
   m_u->spawn_type = params.spawn_type;
@@ -75,8 +75,8 @@ void Swordsman::init(const SpawnParams &params) {
 
   m_mv = e->addComponent<Engine::Core::MovementComponent>();
   if (m_mv != nullptr) {
-    m_mv->goalX = params.position.x();
-    m_mv->goalY = params.position.z();
+    m_mv->goal_x = params.position.x();
+    m_mv->goal_y = params.position.z();
     m_mv->target_x = params.position.x();
     m_mv->target_y = params.position.z();
   }
@@ -87,19 +87,19 @@ void Swordsman::init(const SpawnParams &params) {
   m_atk->damage = profile.combat.ranged_damage;
   m_atk->cooldown = profile.combat.ranged_cooldown;
 
-  m_atk->meleeRange = profile.combat.melee_range;
-  m_atk->meleeDamage = profile.combat.melee_damage;
-  m_atk->meleeCooldown = profile.combat.melee_cooldown;
+  m_atk->melee_range = profile.combat.melee_range;
+  m_atk->melee_damage = profile.combat.melee_damage;
+  m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferredMode = profile.combat.can_ranged
+  m_atk->preferred_mode = profile.combat.can_ranged
                              ? Engine::Core::AttackComponent::CombatMode::Auto
                              : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->currentMode = profile.combat.can_ranged
+  m_atk->current_mode = profile.combat.can_ranged
                            ? Engine::Core::AttackComponent::CombatMode::Ranged
                            : Engine::Core::AttackComponent::CombatMode::Melee;
-  m_atk->canRanged = profile.combat.can_ranged;
-  m_atk->canMelee = profile.combat.can_melee;
-  m_atk->max_heightDifference = 2.0F;
+  m_atk->can_ranged = profile.combat.can_ranged;
+  m_atk->can_melee = profile.combat.can_melee;
+  m_atk->max_height_difference = 2.0F;
 
   Engine::Core::EventManager::instance().publish(
       Engine::Core::UnitSpawnedEvent(m_id, m_u->owner_id, m_u->spawn_type));

+ 7 - 7
game/units/unit.cpp

@@ -60,12 +60,12 @@ void Unit::moveTo(float x, float z) {
   if (m_mv != nullptr) {
     m_mv->target_x = x;
     m_mv->target_y = z;
-    m_mv->hasTarget = true;
-    m_mv->goalX = x;
-    m_mv->goalY = z;
+    m_mv->has_target = true;
+    m_mv->goal_x = x;
+    m_mv->goal_y = z;
     m_mv->path.clear();
-    m_mv->pathPending = false;
-    m_mv->pendingRequestId = 0;
+    m_mv->path_pending = false;
+    m_mv->pending_request_id = 0;
   }
 
   if (auto *e = entity()) {
@@ -111,9 +111,9 @@ void Unit::setHoldMode(bool enabled) {
 
     auto *mv = e->getComponent<Engine::Core::MovementComponent>();
     if (mv != nullptr) {
-      mv->hasTarget = false;
+      mv->has_target = false;
       mv->path.clear();
-      mv->pathPending = false;
+      mv->path_pending = false;
     }
   } else {
     if (hold_comp != nullptr) {

+ 1 - 1
game/visuals/visual_catalog.cpp

@@ -109,7 +109,7 @@ void applyToRenderable(const VisualDef &def,
   r.color[1] = def.color.y();
   r.color[2] = def.color.z();
   if (!def.texture.isEmpty()) {
-    r.texturePath = def.texture.toStdString();
+    r.texture_path = def.texture.toStdString();
   }
 }
 

+ 6 - 6
render/entity/barracks_flag_renderer.h

@@ -28,8 +28,8 @@ inline void draw_rally_flag_if_any(const DrawContext &p, ISubmitter &out,
                                    Texture *white, const FlagColors &colors) {
   if (auto *prod =
           p.entity->getComponent<Engine::Core::ProductionComponent>()) {
-    if (prod->rallySet && (p.resources != nullptr)) {
-      auto flag = Render::Geom::Flag::create(prod->rallyX, prod->rallyZ,
+    if (prod->rally_set && (p.resources != nullptr)) {
+      auto flag = Render::Geom::Flag::create(prod->rally_x, prod->rally_z,
                                              QVector3D(1.0F, 0.9F, 0.2F),
                                              colors.woodDark, 1.0F);
       Mesh *unit = p.resources->unit();
@@ -51,9 +51,9 @@ drawPoleWithBanner(const DrawContext &p, ISubmitter &out, Mesh *unit,
 
   if (enableCapture && p.entity != nullptr) {
     auto *capture = p.entity->getComponent<Engine::Core::CaptureComponent>();
-    if ((capture != nullptr) && capture->isBeingCaptured) {
+    if ((capture != nullptr) && capture->is_being_captured) {
       float const progress = std::clamp(
-          capture->captureProgress / capture->requiredTime, 0.0F, 1.0F);
+          capture->capture_progress / capture->required_time, 0.0F, 1.0F);
       QVector3D const new_team_color =
           Game::Visuals::team_colorForOwner(capture->capturing_player_id);
       actualBannerColor = QVector3D(
@@ -88,9 +88,9 @@ inline CaptureColors get_capture_colors(const DrawContext &p,
 
   if (p.entity != nullptr) {
     auto *capture = p.entity->getComponent<Engine::Core::CaptureComponent>();
-    if ((capture != nullptr) && capture->isBeingCaptured) {
+    if ((capture != nullptr) && capture->is_being_captured) {
       float const progress = std::clamp(
-          capture->captureProgress / capture->requiredTime, 0.0F, 1.0F);
+          capture->capture_progress / capture->required_time, 0.0F, 1.0F);
 
       QVector3D const new_team_color =
           Game::Visuals::team_colorForOwner(capture->capturing_player_id);

+ 4 - 4
render/gl/humanoid/animation/animation_inputs.cpp

@@ -42,18 +42,18 @@ auto sampleAnimState(const DrawContext &ctx) -> AnimationInputs {
     anim.hold_exit_progress =
         1.0F - (hold_mode->exitCooldown / hold_mode->standUpDuration);
   }
-  anim.is_moving = ((movement != nullptr) && movement->hasTarget);
+  anim.is_moving = ((movement != nullptr) && movement->has_target);
 
   if ((attack != nullptr) && (attack_target != nullptr) &&
       attack_target->target_id > 0 && (transform != nullptr)) {
-    anim.is_melee = (attack->currentMode ==
+    anim.is_melee = (attack->current_mode ==
                      Engine::Core::AttackComponent::CombatMode::Melee);
 
     bool const stationary = !anim.is_moving;
     float const current_cooldown =
-        anim.is_melee ? attack->meleeCooldown : attack->cooldown;
+        anim.is_melee ? attack->melee_cooldown : attack->cooldown;
     bool const recently_fired =
-        attack->timeSinceLast < std::min(current_cooldown, 0.45F);
+        attack->time_since_last < std::min(current_cooldown, 0.45F);
     bool target_in_range = false;
 
     if (ctx.world != nullptr) {

+ 2 - 2
render/humanoid/rig.cpp

@@ -1370,7 +1370,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
     inst_ctx.selected = ctx.selected;
     inst_ctx.hovered = ctx.hovered;
     inst_ctx.animationTime = ctx.animationTime;
-    inst_ctx.rendererId = ctx.rendererId;
+    inst_ctx.renderer_id = ctx.renderer_id;
     inst_ctx.backend = ctx.backend;
     inst_ctx.camera = ctx.camera;
 
@@ -1457,7 +1457,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
       if (speed > 1e-4F) {
         anim_ctx.locomotion_direction = velocity.normalized();
       }
-      anim_ctx.has_movement_target = movement_comp->hasTarget;
+      anim_ctx.has_movement_target = movement_comp->has_target;
       anim_ctx.movement_target =
           QVector3D(movement_comp->target_x, 0.0F, movement_comp->target_y);
     }

+ 3 - 3
render/scene_renderer.cpp

@@ -497,8 +497,8 @@ void Renderer::renderWorld(Engine::Core::World *world) {
     bool drawn_by_registry = false;
     if (m_entityRegistry) {
       std::string renderer_key;
-      if (!renderable->rendererId.empty()) {
-        renderer_key = renderable->rendererId;
+      if (!renderable->renderer_id.empty()) {
+        renderer_key = renderable->renderer_id;
       } else if (unit_comp != nullptr) {
         renderer_key = Game::Units::spawn_typeToString(unit_comp->spawn_type);
       }
@@ -509,7 +509,7 @@ void Renderer::renderWorld(Engine::Core::World *world) {
         ctx.selected = is_selected;
         ctx.hovered = is_hovered;
         ctx.animationTime = m_accumulatedTime;
-        ctx.rendererId = renderer_key;
+        ctx.renderer_id = renderer_key;
         ctx.backend = m_backend.get();
         ctx.camera = m_camera;