Browse Source

Merge branch 'main' into copilot/refactor-render-to-snake-case

Adam Djellouli 3 days ago
parent
commit
bde5c2c71a
100 changed files with 2031 additions and 1979 deletions
  1. 2 2
      README.md
  2. 3 3
      app/controllers/action_vfx.cpp
  3. 37 37
      app/controllers/command_controller.cpp
  4. 229 220
      app/core/game_engine.cpp
  5. 125 120
      app/core/game_engine.h
  6. 2 2
      app/models/cursor_manager.cpp
  7. 2 2
      app/models/cursor_manager.h
  8. 11 11
      app/models/graphics_settings_proxy.cpp
  9. 12 11
      app/models/graphics_settings_proxy.h
  10. 5 5
      app/models/hover_tracker.cpp
  11. 3 3
      app/models/hover_tracker.h
  12. 3 3
      app/models/selected_units_model.cpp
  13. 14 14
      app/utils/engine_view_helpers.h
  14. 11 11
      app/utils/movement_utils.h
  15. 7 7
      app/utils/selection_utils.h
  16. 8 8
      game/audio/AudioEventHandler.cpp
  17. 2 2
      game/audio/AudioEventHandler.h
  18. 19 19
      game/audio/AudioSystem.cpp
  19. 7 7
      game/audio/AudioSystem.h
  20. 64 64
      game/core/component.h
  21. 1 1
      game/core/entity.cpp
  22. 6 6
      game/core/entity.h
  23. 23 23
      game/core/event_manager.h
  24. 156 153
      game/core/serialization.cpp
  25. 1 1
      game/core/system.h
  26. 36 35
      game/core/world.cpp
  27. 21 21
      game/core/world.h
  28. 14 14
      game/map/level_loader.cpp
  29. 4 4
      game/map/level_loader.h
  30. 1 1
      game/map/map_definition.h
  31. 1 1
      game/map/map_loader.cpp
  32. 7 7
      game/map/map_transformer.cpp
  33. 1 1
      game/map/map_transformer.h
  34. 14 14
      game/map/skirmish_loader.cpp
  35. 4 4
      game/map/skirmish_loader.h
  36. 3 3
      game/map/visibility_service.cpp
  37. 5 5
      game/map/world_bootstrap.cpp
  38. 5 5
      game/map/world_bootstrap.h
  39. 6 6
      game/systems/ai_system.cpp
  40. 2 2
      game/systems/ai_system.h
  41. 1 1
      game/systems/ai_system/ai_behavior.h
  42. 15 15
      game/systems/ai_system/ai_command_applier.cpp
  43. 2 2
      game/systems/ai_system/ai_executor.cpp
  44. 1 1
      game/systems/ai_system/ai_executor.h
  45. 8 8
      game/systems/ai_system/ai_reasoner.cpp
  46. 1 1
      game/systems/ai_system/ai_reasoner.h
  47. 26 26
      game/systems/ai_system/ai_snapshot_builder.cpp
  48. 16 16
      game/systems/ai_system/ai_types.h
  49. 2 2
      game/systems/ai_system/ai_worker.cpp
  50. 5 5
      game/systems/ai_system/behaviors/attack_behavior.cpp
  51. 1 1
      game/systems/ai_system/behaviors/attack_behavior.h
  52. 6 6
      game/systems/ai_system/behaviors/defend_behavior.cpp
  53. 1 1
      game/systems/ai_system/behaviors/defend_behavior.h
  54. 5 5
      game/systems/ai_system/behaviors/gather_behavior.cpp
  55. 1 1
      game/systems/ai_system/behaviors/gather_behavior.h
  56. 5 5
      game/systems/ai_system/behaviors/production_behavior.cpp
  57. 1 1
      game/systems/ai_system/behaviors/production_behavior.h
  58. 3 3
      game/systems/ai_system/behaviors/retreat_behavior.cpp
  59. 1 1
      game/systems/ai_system/behaviors/retreat_behavior.h
  60. 5 5
      game/systems/arrow_system.cpp
  61. 3 3
      game/systems/arrow_system.h
  62. 5 5
      game/systems/building_collision_registry.cpp
  63. 1 1
      game/systems/building_collision_registry.h
  64. 6 6
      game/systems/camera_follow_system.cpp
  65. 24 24
      game/systems/camera_service.cpp
  66. 8 8
      game/systems/camera_service.h
  67. 53 51
      game/systems/capture_system.cpp
  68. 3 3
      game/systems/capture_system.h
  69. 3 3
      game/systems/cleanup_system.cpp
  70. 1 1
      game/systems/cleanup_system.h
  71. 214 201
      game/systems/combat_system.cpp
  72. 6 6
      game/systems/combat_system.h
  73. 106 106
      game/systems/command_service.cpp
  74. 4 4
      game/systems/command_service.h
  75. 24 23
      game/systems/formation_system.cpp
  76. 8 8
      game/systems/formation_system.h
  77. 33 32
      game/systems/game_state_serializer.cpp
  78. 12 11
      game/systems/game_state_serializer.h
  79. 54 53
      game/systems/global_stats_registry.cpp
  80. 21 17
      game/systems/global_stats_registry.h
  81. 16 16
      game/systems/healing_system.cpp
  82. 2 2
      game/systems/healing_system.h
  83. 75 75
      game/systems/movement_system.cpp
  84. 5 5
      game/systems/movement_system.h
  85. 8 8
      game/systems/nation_loader.cpp
  86. 17 17
      game/systems/nation_registry.cpp
  87. 10 9
      game/systems/nation_registry.h
  88. 32 31
      game/systems/pathfinding.cpp
  89. 9 9
      game/systems/pathfinding.h
  90. 20 20
      game/systems/patrol_system.cpp
  91. 1 1
      game/systems/patrol_system.h
  92. 57 55
      game/systems/picking_service.cpp
  93. 30 28
      game/systems/picking_service.h
  94. 30 30
      game/systems/production_service.cpp
  95. 8 8
      game/systems/production_service.h
  96. 30 30
      game/systems/production_system.cpp
  97. 1 1
      game/systems/production_system.h
  98. 79 75
      game/systems/selection_system.cpp
  99. 26 26
      game/systems/selection_system.h
  100. 3 3
      game/systems/terrain_alignment_system.cpp

+ 2 - 2
README.md

@@ -274,10 +274,10 @@ Q_INVOKABLE void onMyCommand(qreal sx, qreal sy);
 void GameEngine::onMyCommand(qreal sx, qreal sy) {
     // Convert screen to world coordinates
     QVector3D hit;
-    if (!screenToGround(QPointF(sx, sy), hit)) return;
+    if (!screen_to_ground(QPointF(sx, sy), hit)) return;
     
     // Issue command to selected units
-    const auto& selected = m_selection_system->getSelectedUnits();
+    const auto& selected = m_selection_system->get_selected_units();
     for (auto id : selected) {
         // Process command...
     }

+ 3 - 3
app/controllers/action_vfx.cpp

@@ -14,18 +14,18 @@ void ActionVFX::spawnAttackArrow(Engine::Core::World *world,
     return;
   }
 
-  auto *arrow_system = world->getSystem<Game::Systems::ArrowSystem>();
+  auto *arrow_system = world->get_system<Game::Systems::ArrowSystem>();
   if (arrow_system == nullptr) {
     return;
   }
 
-  auto *target_entity = world->getEntity(target_id);
+  auto *target_entity = world->get_entity(target_id);
   if (target_entity == nullptr) {
     return;
   }
 
   auto *target_trans =
-      target_entity->getComponent<Engine::Core::TransformComponent>();
+      target_entity->get_component<Engine::Core::TransformComponent>();
   if (target_trans == nullptr) {
     return;
   }

+ 37 - 37
app/controllers/command_controller.cpp

@@ -34,7 +34,7 @@ auto CommandController::onAttackClick(qreal sx, qreal sy, int viewportWidth,
     return result;
   }
 
-  const auto &selected = m_selection_system->getSelectedUnits();
+  const auto &selected = m_selection_system->get_selected_units();
   if (selected.empty()) {
     result.resetCursorToNormal = true;
     return result;
@@ -42,7 +42,7 @@ auto CommandController::onAttackClick(qreal sx, qreal sy, int viewportWidth,
 
   auto *cam = static_cast<Render::GL::Camera *>(camera);
   Engine::Core::EntityID const target_id =
-      Game::Systems::PickingService::pickUnitFirst(
+      Game::Systems::PickingService::pick_unit_first(
           float(sx), float(sy), *m_world, *cam, viewportWidth, viewportHeight,
           0);
 
@@ -51,13 +51,13 @@ auto CommandController::onAttackClick(qreal sx, qreal sy, int viewportWidth,
     return result;
   }
 
-  auto *target_entity = m_world->getEntity(target_id);
+  auto *target_entity = m_world->get_entity(target_id);
   if (target_entity == nullptr) {
     return result;
   }
 
   auto *target_unit =
-      target_entity->getComponent<Engine::Core::UnitComponent>();
+      target_entity->get_component<Engine::Core::UnitComponent>();
   if (target_unit == nullptr) {
     return result;
   }
@@ -78,29 +78,29 @@ auto CommandController::onStopCommand() -> CommandResult {
     return result;
   }
 
-  const auto &selected = m_selection_system->getSelectedUnits();
+  const auto &selected = m_selection_system->get_selected_units();
   if (selected.empty()) {
     return result;
   }
 
   for (auto id : selected) {
-    auto *entity = m_world->getEntity(id);
+    auto *entity = m_world->get_entity(id);
     if (entity == nullptr) {
       continue;
     }
 
     resetMovement(entity);
-    entity->removeComponent<Engine::Core::AttackTargetComponent>();
+    entity->remove_component<Engine::Core::AttackTargetComponent>();
 
-    if (auto *patrol = entity->getComponent<Engine::Core::PatrolComponent>()) {
+    if (auto *patrol = entity->get_component<Engine::Core::PatrolComponent>()) {
       patrol->patrolling = false;
       patrol->waypoints.clear();
     }
 
-    auto *hold_mode = entity->getComponent<Engine::Core::HoldModeComponent>();
+    auto *hold_mode = entity->get_component<Engine::Core::HoldModeComponent>();
     if ((hold_mode != nullptr) && hold_mode->active) {
       hold_mode->active = false;
-      hold_mode->exitCooldown = hold_mode->standUpDuration;
+      hold_mode->exit_cooldown = hold_mode->stand_up_duration;
       emit hold_modeChanged(false);
     }
   }
@@ -116,18 +116,18 @@ auto CommandController::onHoldCommand() -> CommandResult {
     return result;
   }
 
-  const auto &selected = m_selection_system->getSelectedUnits();
+  const auto &selected = m_selection_system->get_selected_units();
   if (selected.empty()) {
     return result;
   }
 
   for (auto id : selected) {
-    auto *entity = m_world->getEntity(id);
+    auto *entity = m_world->get_entity(id);
     if (entity == nullptr) {
       continue;
     }
 
-    auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+    auto *unit = entity->get_component<Engine::Core::UnitComponent>();
 
     if ((unit == nullptr) ||
         (unit->spawn_type != Game::Units::SpawnType::Archer &&
@@ -135,35 +135,35 @@ auto CommandController::onHoldCommand() -> CommandResult {
       continue;
     }
 
-    auto *hold_mode = entity->getComponent<Engine::Core::HoldModeComponent>();
+    auto *hold_mode = entity->get_component<Engine::Core::HoldModeComponent>();
 
     if ((hold_mode != nullptr) && hold_mode->active) {
       hold_mode->active = false;
-      hold_mode->exitCooldown = hold_mode->standUpDuration;
+      hold_mode->exit_cooldown = hold_mode->stand_up_duration;
       emit hold_modeChanged(false);
       continue;
     }
 
     resetMovement(entity);
-    entity->removeComponent<Engine::Core::AttackTargetComponent>();
+    entity->remove_component<Engine::Core::AttackTargetComponent>();
 
-    if (auto *patrol = entity->getComponent<Engine::Core::PatrolComponent>()) {
+    if (auto *patrol = entity->get_component<Engine::Core::PatrolComponent>()) {
       patrol->patrolling = false;
       patrol->waypoints.clear();
     }
 
     if (hold_mode == nullptr) {
-      hold_mode = entity->addComponent<Engine::Core::HoldModeComponent>();
+      hold_mode = entity->add_component<Engine::Core::HoldModeComponent>();
     }
     hold_mode->active = true;
-    hold_mode->exitCooldown = 0.0F;
+    hold_mode->exit_cooldown = 0.0F;
     emit hold_modeChanged(true);
 
-    auto *movement = entity->getComponent<Engine::Core::MovementComponent>();
+    auto *movement = entity->get_component<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;
     }
@@ -187,7 +187,7 @@ auto CommandController::onPatrolClick(qreal sx, qreal sy, int viewportWidth,
     return result;
   }
 
-  const auto &selected = m_selection_system->getSelectedUnits();
+  const auto &selected = m_selection_system->get_selected_units();
   if (selected.empty()) {
     if (m_hasPatrolFirstWaypoint) {
       clearPatrolFirstWaypoint();
@@ -198,7 +198,7 @@ auto CommandController::onPatrolClick(qreal sx, qreal sy, int viewportWidth,
 
   auto *cam = static_cast<Render::GL::Camera *>(camera);
   QVector3D hit;
-  if (!Game::Systems::PickingService::screenToGround(
+  if (!Game::Systems::PickingService::screen_to_ground(
           QPointF(sx, sy), *cam, viewportWidth, viewportHeight, hit)) {
     if (m_hasPatrolFirstWaypoint) {
       clearPatrolFirstWaypoint();
@@ -217,19 +217,19 @@ auto CommandController::onPatrolClick(qreal sx, qreal sy, int viewportWidth,
   QVector3D const second_waypoint = hit;
 
   for (auto id : selected) {
-    auto *entity = m_world->getEntity(id);
+    auto *entity = m_world->get_entity(id);
     if (entity == nullptr) {
       continue;
     }
 
-    auto *building = entity->getComponent<Engine::Core::BuildingComponent>();
+    auto *building = entity->get_component<Engine::Core::BuildingComponent>();
     if (building != nullptr) {
       continue;
     }
 
-    auto *patrol = entity->getComponent<Engine::Core::PatrolComponent>();
+    auto *patrol = entity->get_component<Engine::Core::PatrolComponent>();
     if (patrol == nullptr) {
-      patrol = entity->addComponent<Engine::Core::PatrolComponent>();
+      patrol = entity->add_component<Engine::Core::PatrolComponent>();
     }
 
     if (patrol != nullptr) {
@@ -237,12 +237,12 @@ 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;
     }
 
     resetMovement(entity);
-    entity->removeComponent<Engine::Core::AttackTargetComponent>();
+    entity->remove_component<Engine::Core::AttackTargetComponent>();
   }
 
   clearPatrolFirstWaypoint();
@@ -262,13 +262,13 @@ auto CommandController::setRallyAtScreen(qreal sx, qreal sy, int viewportWidth,
 
   auto *cam = static_cast<Render::GL::Camera *>(camera);
   QVector3D hit;
-  if (!Game::Systems::PickingService::screenToGround(
+  if (!Game::Systems::PickingService::screen_to_ground(
           QPointF(sx, sy), *cam, viewportWidth, viewportHeight, hit)) {
     return result;
   }
 
   Game::Systems::ProductionService::setRallyForFirstSelectedBarracks(
-      *m_world, m_selection_system->getSelectedUnits(), localOwnerId, hit.x(),
+      *m_world, m_selection_system->get_selected_units(), localOwnerId, hit.x(),
       hit.z());
 
   result.inputConsumed = true;
@@ -281,7 +281,7 @@ void CommandController::recruitNearSelected(const QString &unit_type,
     return;
   }
 
-  const auto &sel = m_selection_system->getSelectedUnits();
+  const auto &sel = m_selection_system->get_selected_units();
   if (sel.empty()) {
     return;
   }
@@ -296,7 +296,7 @@ void CommandController::recruitNearSelected(const QString &unit_type,
 }
 
 void CommandController::resetMovement(Engine::Core::Entity *entity) {
-  App::Utils::resetMovement(entity);
+  App::Utils::reset_movement(entity);
 }
 
 auto CommandController::anySelectedInHoldMode() const -> bool {
@@ -304,14 +304,14 @@ auto CommandController::anySelectedInHoldMode() const -> bool {
     return false;
   }
 
-  const auto &selected = m_selection_system->getSelectedUnits();
+  const auto &selected = m_selection_system->get_selected_units();
   for (Engine::Core::EntityID const entity_id : selected) {
-    Engine::Core::Entity *entity = m_world->getEntity(entity_id);
+    Engine::Core::Entity *entity = m_world->get_entity(entity_id);
     if (entity == nullptr) {
       continue;
     }
 
-    auto *hold_mode = entity->getComponent<Engine::Core::HoldModeComponent>();
+    auto *hold_mode = entity->get_component<Engine::Core::HoldModeComponent>();
     if ((hold_mode != nullptr) && hold_mode->active) {
       return true;
     }

File diff suppressed because it is too large
+ 229 - 220
app/core/game_engine.cpp


+ 125 - 120
app/core/game_engine.h

@@ -83,104 +83,110 @@ public:
   explicit GameEngine(QObject *parent = nullptr);
   ~GameEngine() override;
 
-  void cleanupOpenGLResources();
+  void cleanup_opengl_resources();
 
-  Q_PROPERTY(QAbstractItemModel *selectedUnitsModel READ selectedUnitsModel
-                 NOTIFY selectedUnitsChanged)
-  Q_PROPERTY(bool paused READ paused WRITE setPaused)
-  Q_PROPERTY(float timeScale READ timeScale WRITE setGameSpeed)
-  Q_PROPERTY(QString victoryState READ victoryState NOTIFY victoryStateChanged)
-  Q_PROPERTY(QString cursorMode READ cursorMode WRITE setCursorMode NOTIFY
-                 cursorModeChanged)
-  Q_PROPERTY(qreal globalCursorX READ globalCursorX NOTIFY globalCursorChanged)
-  Q_PROPERTY(qreal globalCursorY READ globalCursorY NOTIFY globalCursorChanged)
+  Q_PROPERTY(QAbstractItemModel *selected_units_model READ selected_units_model
+                 NOTIFY selected_units_changed)
+  Q_PROPERTY(bool paused READ paused WRITE set_paused)
+  Q_PROPERTY(float time_scale READ time_scale WRITE set_game_speed)
   Q_PROPERTY(
-      bool hasUnitsSelected READ hasUnitsSelected NOTIFY selectedUnitsChanged)
+      QString victory_state READ victory_state NOTIFY victory_state_changed)
+  Q_PROPERTY(QString cursor_mode READ cursor_mode WRITE set_cursor_mode NOTIFY
+                 cursor_mode_changed)
   Q_PROPERTY(
-      int playerTroopCount READ playerTroopCount NOTIFY troop_countChanged)
+      qreal global_cursor_x READ global_cursor_x NOTIFY global_cursor_changed)
+  Q_PROPERTY(
+      qreal global_cursor_y READ global_cursor_y NOTIFY global_cursor_changed)
+  Q_PROPERTY(bool has_units_selected READ has_units_selected NOTIFY
+                 selected_units_changed)
+  Q_PROPERTY(
+      int player_troop_count READ player_troop_count NOTIFY troop_count_changed)
   Q_PROPERTY(int max_troops_per_player READ max_troops_per_player NOTIFY
-                 troop_countChanged)
+                 troop_count_changed)
   Q_PROPERTY(QVariantList available_maps READ available_maps NOTIFY
                  available_maps_changed)
   Q_PROPERTY(bool maps_loading READ maps_loading NOTIFY maps_loading_changed)
   Q_PROPERTY(QVariantList available_nations READ available_nations CONSTANT)
   Q_PROPERTY(QVariantList available_campaigns READ available_campaigns NOTIFY
                  available_campaigns_changed)
-  Q_PROPERTY(int enemyTroopsDefeated READ enemyTroopsDefeated NOTIFY
-                 enemyTroopsDefeatedChanged)
-  Q_PROPERTY(QVariantList ownerInfo READ getOwnerInfo NOTIFY ownerInfoChanged)
-  Q_PROPERTY(int selectedPlayerId READ selectedPlayerId WRITE
-                 setSelectedPlayerId NOTIFY selectedPlayerIdChanged)
-  Q_PROPERTY(QString lastError READ lastError NOTIFY lastErrorChanged)
+  Q_PROPERTY(int enemy_troops_defeated READ enemy_troops_defeated NOTIFY
+                 enemy_troops_defeated_changed)
+  Q_PROPERTY(
+      QVariantList owner_info READ get_owner_info NOTIFY owner_info_changed)
+  Q_PROPERTY(int selected_player_id READ selected_player_id WRITE
+                 set_selected_player_id NOTIFY selected_player_id_changed)
+  Q_PROPERTY(QString last_error READ last_error NOTIFY last_error_changed)
   Q_PROPERTY(QObject *audio_system READ audio_system CONSTANT)
 
-  Q_INVOKABLE void onMapClicked(qreal sx, qreal sy);
-  Q_INVOKABLE void onRightClick(qreal sx, qreal sy);
-  Q_INVOKABLE void onClickSelect(qreal sx, qreal sy, bool additive = false);
-  Q_INVOKABLE void onAreaSelected(qreal x1, qreal y1, qreal x2, qreal y2,
-                                  bool additive = false);
-  Q_INVOKABLE void selectAllTroops();
-  Q_INVOKABLE void selectUnitById(int unitId);
-  Q_INVOKABLE void setHoverAtScreen(qreal sx, qreal sy);
-  Q_INVOKABLE void onAttackClick(qreal sx, qreal sy);
-  Q_INVOKABLE void onStopCommand();
-  Q_INVOKABLE void onHoldCommand();
-  Q_INVOKABLE [[nodiscard]] bool anySelectedInHoldMode() const;
-  Q_INVOKABLE void onPatrolClick(qreal sx, qreal sy);
+  Q_INVOKABLE void on_map_clicked(qreal sx, qreal sy);
+  Q_INVOKABLE void on_right_click(qreal sx, qreal sy);
+  Q_INVOKABLE void on_click_select(qreal sx, qreal sy, bool additive = false);
+  Q_INVOKABLE void on_area_selected(qreal x1, qreal y1, qreal x2, qreal y2,
+                                    bool additive = false);
+  Q_INVOKABLE void select_all_troops();
+  Q_INVOKABLE void select_unit_by_id(int unitId);
+  Q_INVOKABLE void set_hover_at_screen(qreal sx, qreal sy);
+  Q_INVOKABLE void on_attack_click(qreal sx, qreal sy);
+  Q_INVOKABLE void on_stop_command();
+  Q_INVOKABLE void on_hold_command();
+  Q_INVOKABLE [[nodiscard]] bool any_selected_in_hold_mode() const;
+  Q_INVOKABLE void on_patrol_click(qreal sx, qreal sy);
 
-  Q_INVOKABLE void cameraMove(float dx, float dz);
-  Q_INVOKABLE void cameraElevate(float dy);
-  Q_INVOKABLE void resetCamera();
-  Q_INVOKABLE void cameraZoom(float delta);
-  Q_INVOKABLE [[nodiscard]] float cameraDistance() const;
-  Q_INVOKABLE void cameraYaw(float degrees);
-  Q_INVOKABLE void cameraOrbit(float yaw_deg, float pitch_deg);
-  Q_INVOKABLE void cameraOrbitDirection(int direction, bool shift);
-  Q_INVOKABLE void cameraFollowSelection(bool enable);
-  Q_INVOKABLE void cameraSetFollowLerp(float alpha);
+  Q_INVOKABLE void camera_move(float dx, float dz);
+  Q_INVOKABLE void camera_elevate(float dy);
+  Q_INVOKABLE void reset_camera();
+  Q_INVOKABLE void camera_zoom(float delta);
+  Q_INVOKABLE [[nodiscard]] float camera_distance() const;
+  Q_INVOKABLE void camera_yaw(float degrees);
+  Q_INVOKABLE void camera_orbit(float yaw_deg, float pitch_deg);
+  Q_INVOKABLE void camera_orbit_direction(int direction, bool shift);
+  Q_INVOKABLE void camera_follow_selection(bool enable);
+  Q_INVOKABLE void camera_set_follow_lerp(float alpha);
   Q_INVOKABLE void start_loading_maps();
 
-  Q_INVOKABLE void setPaused(bool paused) { m_runtime.paused = paused; }
-  Q_INVOKABLE void setGameSpeed(float speed) {
-    m_runtime.timeScale = std::max(0.0F, speed);
+  Q_INVOKABLE void set_paused(bool paused) { m_runtime.paused = paused; }
+  Q_INVOKABLE void set_game_speed(float speed) {
+    m_runtime.time_scale = std::max(0.0F, speed);
   }
   [[nodiscard]] bool paused() const { return m_runtime.paused; }
-  [[nodiscard]] float timeScale() const { return m_runtime.timeScale; }
-  [[nodiscard]] QString victoryState() const { return m_runtime.victoryState; }
-  [[nodiscard]] QString cursorMode() const;
-  void setCursorMode(CursorMode mode);
-  void setCursorMode(const QString &mode);
-  [[nodiscard]] qreal globalCursorX() const;
-  [[nodiscard]] qreal globalCursorY() const;
-  [[nodiscard]] bool hasUnitsSelected() const;
-  [[nodiscard]] int playerTroopCount() const;
+  [[nodiscard]] float time_scale() const { return m_runtime.time_scale; }
+  [[nodiscard]] QString victory_state() const {
+    return m_runtime.victory_state;
+  }
+  [[nodiscard]] QString cursor_mode() const;
+  void set_cursor_mode(CursorMode mode);
+  void set_cursor_mode(const QString &mode);
+  [[nodiscard]] qreal global_cursor_x() const;
+  [[nodiscard]] qreal global_cursor_y() const;
+  [[nodiscard]] bool has_units_selected() const;
+  [[nodiscard]] int player_troop_count() const;
   [[nodiscard]] int max_troops_per_player() const {
     return m_level.max_troops_per_player;
   }
-  [[nodiscard]] int enemyTroopsDefeated() const;
+  [[nodiscard]] int enemy_troops_defeated() const;
 
-  Q_INVOKABLE [[nodiscard]] static QVariantMap getPlayerStats(int owner_id);
+  Q_INVOKABLE [[nodiscard]] static QVariantMap get_player_stats(int owner_id);
 
-  [[nodiscard]] int selectedPlayerId() const { return m_selectedPlayerId; }
-  void setSelectedPlayerId(int id) {
+  [[nodiscard]] int selected_player_id() const { return m_selectedPlayerId; }
+  void set_selected_player_id(int id) {
     if (m_selectedPlayerId != id) {
       m_selectedPlayerId = id;
-      emit selectedPlayerIdChanged();
+      emit selected_player_id_changed();
     }
   }
-  [[nodiscard]] QString lastError() const { return m_runtime.lastError; }
-  Q_INVOKABLE void clearError() {
-    if (!m_runtime.lastError.isEmpty()) {
-      m_runtime.lastError = "";
-      emit lastErrorChanged();
+  [[nodiscard]] QString last_error() const { return m_runtime.last_error; }
+  Q_INVOKABLE void clear_error() {
+    if (!m_runtime.last_error.isEmpty()) {
+      m_runtime.last_error = "";
+      emit last_error_changed();
     }
   }
 
-  Q_INVOKABLE [[nodiscard]] bool hasSelectedType(const QString &type) const;
-  Q_INVOKABLE void recruitNearSelected(const QString &unit_type);
-  Q_INVOKABLE [[nodiscard]] QVariantMap getSelectedProductionState() const;
-  Q_INVOKABLE [[nodiscard]] QString getSelectedUnitsCommandMode() const;
-  Q_INVOKABLE void setRallyAtScreen(qreal sx, qreal sy);
+  Q_INVOKABLE [[nodiscard]] bool has_selected_type(const QString &type) const;
+  Q_INVOKABLE void recruit_near_selected(const QString &unit_type);
+  Q_INVOKABLE [[nodiscard]] QVariantMap get_selected_production_state() const;
+  Q_INVOKABLE [[nodiscard]] QString get_selected_units_command_mode() const;
+  Q_INVOKABLE void set_rally_at_screen(qreal sx, qreal sy);
   Q_INVOKABLE [[nodiscard]] QVariantList available_maps() const;
   [[nodiscard]] QVariantList available_nations() const;
   [[nodiscard]] QVariantList available_campaigns() const;
@@ -199,35 +205,35 @@ public:
   Q_INVOKABLE void refresh_save_slots();
   Q_INVOKABLE bool delete_save_slot(const QString &slot_name);
   Q_INVOKABLE void exit_game();
-  Q_INVOKABLE [[nodiscard]] QVariantList getOwnerInfo() const;
+  Q_INVOKABLE [[nodiscard]] QVariantList get_owner_info() const;
 
   QObject *audio_system();
 
   void setWindow(QQuickWindow *w) { m_window = w; }
 
-  void ensureInitialized();
+  void ensure_initialized();
   void update(float dt);
   void render(int pixelWidth, int pixelHeight);
 
-  void getSelectedUnitIds(std::vector<Engine::Core::EntityID> &out) const;
-  bool getUnitInfo(Engine::Core::EntityID id, QString &name, int &health,
-                   int &max_health, bool &isBuilding, bool &alive,
-                   QString &nation) const;
+  void get_selected_unit_ids(std::vector<Engine::Core::EntityID> &out) const;
+  bool get_unit_info(Engine::Core::EntityID id, QString &name, int &health,
+                     int &max_health, bool &isBuilding, bool &alive,
+                     QString &nation) const;
 
-  [[nodiscard]] bool hasPatrolPreviewWaypoint() const;
-  [[nodiscard]] QVector3D getPatrolPreviewWaypoint() const;
+  [[nodiscard]] bool has_patrol_preview_waypoint() const;
+  [[nodiscard]] QVector3D get_patrol_preview_waypoint() const;
 
 private:
   struct RuntimeState {
     bool initialized = false;
     bool paused = false;
     bool loading = false;
-    float timeScale = 1.0F;
-    int localOwnerId = 1;
-    QString victoryState = "";
-    CursorMode cursorMode{CursorMode::Normal};
-    QString lastError = "";
-    Qt::CursorShape currentCursor = Qt::ArrowCursor;
+    float time_scale = 1.0F;
+    int local_owner_id = 1;
+    QString victory_state = "";
+    CursorMode cursor_mode{CursorMode::Normal};
+    QString last_error = "";
+    Qt::CursorShape current_cursor = Qt::ArrowCursor;
     int lastTroopCount = 0;
     std::uint64_t visibilityVersion = 0;
     float visibilityUpdateAccumulator = 0.0F;
@@ -253,24 +259,24 @@ private:
     int height = 0;
   };
 
-  bool screenToGround(const QPointF &screenPt, QVector3D &outWorld);
-  bool worldToScreen(const QVector3D &world, QPointF &outScreen) const;
-  void syncSelectionFlags();
-  static void resetMovement(Engine::Core::Entity *entity);
-  QAbstractItemModel *selectedUnitsModel();
-  void onUnitSpawned(const Engine::Core::UnitSpawnedEvent &event);
-  void onUnitDied(const Engine::Core::UnitDiedEvent &event);
-  void rebuildEntityCache();
-  void rebuildRegistriesAfterLoad();
-  void rebuildBuildingCollisions();
-  void restoreEnvironmentFromMetadata(const QJsonObject &metadata);
-  void updateCursor(Qt::CursorShape newCursor);
-  void setError(const QString &errorMessage);
-  bool loadFromSlot(const QString &slot);
-  bool saveToSlot(const QString &slot, const QString &title);
-  [[nodiscard]] Game::Systems::RuntimeSnapshot toRuntimeSnapshot() const;
-  void applyRuntimeSnapshot(const Game::Systems::RuntimeSnapshot &snapshot);
-  [[nodiscard]] QByteArray captureScreenshot() const;
+  bool screen_to_ground(const QPointF &screenPt, QVector3D &outWorld);
+  bool world_to_screen(const QVector3D &world, QPointF &outScreen) const;
+  void sync_selection_flags();
+  static void reset_movement(Engine::Core::Entity *entity);
+  QAbstractItemModel *selected_units_model();
+  void on_unit_spawned(const Engine::Core::UnitSpawnedEvent &event);
+  void on_unit_died(const Engine::Core::UnitDiedEvent &event);
+  void rebuild_entity_cache();
+  void rebuild_registries_after_load();
+  void rebuild_building_collisions();
+  void restore_environment_from_metadata(const QJsonObject &metadata);
+  void update_cursor(Qt::CursorShape newCursor);
+  void set_error(const QString &errorMessage);
+  bool load_from_slot(const QString &slot);
+  bool save_to_slot(const QString &slot, const QString &title);
+  [[nodiscard]] Game::Systems::RuntimeSnapshot to_runtime_snapshot() const;
+  void apply_runtime_snapshot(const Game::Systems::RuntimeSnapshot &snapshot);
+  [[nodiscard]] QByteArray capture_screenshot() const;
 
   std::unique_ptr<Engine::Core::World> m_world;
   std::unique_ptr<Render::GL::Renderer> m_renderer;
@@ -314,33 +320,32 @@ private:
   bool m_maps_loading = false;
   QString m_current_campaign_id;
   Engine::Core::ScopedEventSubscription<Engine::Core::UnitDiedEvent>
-      m_unitDiedSubscription;
+      m_unit_died_subscription;
   Engine::Core::ScopedEventSubscription<Engine::Core::UnitSpawnedEvent>
-      m_unitSpawnedSubscription;
+      m_unit_spawned_subscription;
   EntityCache m_entityCache;
   Engine::Core::AmbientState m_currentAmbientState =
       Engine::Core::AmbientState::PEACEFUL;
   float m_ambientCheckTimer = 0.0F;
 
-  void updateAmbientState(float dt);
-  [[nodiscard]] bool isPlayerInCombat() const;
-  static void loadAudioResources();
+  void update_ambient_state(float dt);
+  [[nodiscard]] bool is_player_in_combat() const;
+  static void load_audio_resources();
   void load_campaigns();
 signals:
-  void selectedUnitsChanged();
-  void selectedUnitsDataChanged();
-  void enemyTroopsDefeatedChanged();
-  void victoryStateChanged();
-  void cursorModeChanged();
-  void globalCursorChanged();
-  void troop_countChanged();
+  void selected_units_changed();
+  void selected_units_data_changed();
+  void enemy_troops_defeated_changed();
+  void victory_state_changed();
+  void cursor_mode_changed();
+  void global_cursor_changed();
+  void troop_count_changed();
   void available_maps_changed();
-  void maps_loading_changed();
   void available_campaigns_changed();
-  void ownerInfoChanged();
-  void selectedPlayerIdChanged();
-  void lastErrorChanged();
-  void mapsLoadingChanged();
-  void saveSlotsChanged();
-  void holdModeChanged(bool active);
+  void owner_info_changed();
+  void selected_player_id_changed();
+  void last_error_changed();
+  void maps_loading_changed();
+  void save_slots_changed();
+  void hold_mode_changed(bool active);
 };

+ 2 - 2
app/models/cursor_manager.cpp

@@ -45,7 +45,7 @@ void CursorManager::updateCursorShape(QQuickWindow *window) {
   }
 }
 
-auto CursorManager::globalCursorX(QQuickWindow *window) -> qreal {
+auto CursorManager::global_cursor_x(QQuickWindow *window) -> qreal {
   if (window == nullptr) {
     return 0;
   }
@@ -54,7 +54,7 @@ auto CursorManager::globalCursorX(QQuickWindow *window) -> qreal {
   return local_pos.x();
 }
 
-auto CursorManager::globalCursorY(QQuickWindow *window) -> qreal {
+auto CursorManager::global_cursor_y(QQuickWindow *window) -> qreal {
   if (window == nullptr) {
     return 0;
   }

+ 2 - 2
app/models/cursor_manager.h

@@ -22,8 +22,8 @@ public:
 
   void updateCursorShape(QQuickWindow *window);
 
-  static auto globalCursorX(QQuickWindow *window) -> qreal;
-  static auto globalCursorY(QQuickWindow *window) -> qreal;
+  static auto global_cursor_x(QQuickWindow *window) -> qreal;
+  static auto global_cursor_y(QQuickWindow *window) -> qreal;
 
   [[nodiscard]] auto hasPatrolFirstWaypoint() const -> bool {
     return m_hasFirstWaypoint;

+ 11 - 11
app/models/graphics_settings_proxy.cpp

@@ -7,11 +7,11 @@ namespace App::Models {
 GraphicsSettingsProxy::GraphicsSettingsProxy(QObject *parent)
     : QObject(parent) {}
 
-int GraphicsSettingsProxy::qualityLevel() const {
+int GraphicsSettingsProxy::quality_level() const {
   return static_cast<int>(Render::GraphicsSettings::instance().quality());
 }
 
-void GraphicsSettingsProxy::setQualityLevel(int level) {
+void GraphicsSettingsProxy::set_quality_level(int level) {
   if (level < 0 || level > 3) {
     return;
   }
@@ -19,11 +19,11 @@ void GraphicsSettingsProxy::setQualityLevel(int level) {
   auto newQuality = static_cast<Render::GraphicsQuality>(level);
   if (newQuality != Render::GraphicsSettings::instance().quality()) {
     Render::GraphicsSettings::instance().setQuality(newQuality);
-    emit qualityLevelChanged();
+    emit quality_level_changed();
   }
 }
 
-QString GraphicsSettingsProxy::qualityName() const {
+QString GraphicsSettingsProxy::quality_name() const {
   switch (Render::GraphicsSettings::instance().quality()) {
   case Render::GraphicsQuality::Low:
     return tr("Low");
@@ -37,23 +37,23 @@ QString GraphicsSettingsProxy::qualityName() const {
   return tr("Medium");
 }
 
-QStringList GraphicsSettingsProxy::qualityOptions() const {
+QStringList GraphicsSettingsProxy::quality_options() const {
   return {tr("Low"), tr("Medium"), tr("High"), tr("Ultra")};
 }
 
-void GraphicsSettingsProxy::setQualityByName(const QString &name) {
+void GraphicsSettingsProxy::set_quality_by_name(const QString &name) {
   if (name == tr("Low")) {
-    setQualityLevel(0);
+    set_quality_level(0);
   } else if (name == tr("Medium")) {
-    setQualityLevel(1);
+    set_quality_level(1);
   } else if (name == tr("High")) {
-    setQualityLevel(2);
+    set_quality_level(2);
   } else if (name == tr("Ultra")) {
-    setQualityLevel(3);
+    set_quality_level(3);
   }
 }
 
-QString GraphicsSettingsProxy::getQualityDescription() const {
+QString GraphicsSettingsProxy::get_quality_description() const {
   switch (Render::GraphicsSettings::instance().quality()) {
   case Render::GraphicsQuality::Low:
     return tr(

+ 12 - 11
app/models/graphics_settings_proxy.h

@@ -8,27 +8,28 @@ namespace App::Models {
 
 class GraphicsSettingsProxy : public QObject {
   Q_OBJECT
-  Q_PROPERTY(int qualityLevel READ qualityLevel WRITE setQualityLevel NOTIFY
-                 qualityLevelChanged)
-  Q_PROPERTY(QString qualityName READ qualityName NOTIFY qualityLevelChanged)
-  Q_PROPERTY(QStringList qualityOptions READ qualityOptions CONSTANT)
+  Q_PROPERTY(int quality_level READ quality_level WRITE set_quality_level NOTIFY
+                 quality_level_changed)
+  Q_PROPERTY(
+      QString quality_name READ quality_name NOTIFY quality_level_changed)
+  Q_PROPERTY(QStringList quality_options READ quality_options CONSTANT)
 
 public:
   explicit GraphicsSettingsProxy(QObject *parent = nullptr);
   ~GraphicsSettingsProxy() override = default;
 
-  [[nodiscard]] int qualityLevel() const;
-  void setQualityLevel(int level);
+  [[nodiscard]] int quality_level() const;
+  void set_quality_level(int level);
 
-  [[nodiscard]] QString qualityName() const;
+  [[nodiscard]] QString quality_name() const;
 
-  [[nodiscard]] QStringList qualityOptions() const;
+  [[nodiscard]] QStringList quality_options() const;
 
-  Q_INVOKABLE void setQualityByName(const QString &name);
-  Q_INVOKABLE QString getQualityDescription() const;
+  Q_INVOKABLE void set_quality_by_name(const QString &name);
+  Q_INVOKABLE QString get_quality_description() const;
 
 signals:
-  void qualityLevelChanged();
+  void quality_level_changed();
 };
 
 } // namespace App::Models

+ 5 - 5
app/models/hover_tracker.cpp

@@ -6,10 +6,10 @@
 HoverTracker::HoverTracker(Game::Systems::PickingService *pickingService)
     : m_pickingService(pickingService) {}
 
-auto HoverTracker::updateHover(float sx, float sy, Engine::Core::World &world,
-                               const Render::GL::Camera &camera,
-                               int viewportWidth,
-                               int viewportHeight) -> Engine::Core::EntityID {
+auto HoverTracker::update_hover(float sx, float sy, Engine::Core::World &world,
+                                const Render::GL::Camera &camera,
+                                int viewportWidth,
+                                int viewportHeight) -> Engine::Core::EntityID {
   if (m_pickingService == nullptr) {
     return 0;
   }
@@ -19,7 +19,7 @@ auto HoverTracker::updateHover(float sx, float sy, Engine::Core::World &world,
     return 0;
   }
 
-  m_hoveredEntityId = m_pickingService->updateHover(
+  m_hoveredEntityId = m_pickingService->update_hover(
       sx, sy, world, camera, viewportWidth, viewportHeight);
 
   return m_hoveredEntityId;

+ 3 - 3
app/models/hover_tracker.h

@@ -16,9 +16,9 @@ class HoverTracker {
 public:
   HoverTracker(Game::Systems::PickingService *pickingService);
 
-  auto updateHover(float sx, float sy, Engine::Core::World &world,
-                   const Render::GL::Camera &camera, int viewportWidth,
-                   int viewportHeight) -> Engine::Core::EntityID;
+  auto update_hover(float sx, float sy, Engine::Core::World &world,
+                    const Render::GL::Camera &camera, int viewportWidth,
+                    int viewportHeight) -> Engine::Core::EntityID;
 
   [[nodiscard]] auto getLastHoveredEntity() const -> Engine::Core::EntityID {
     return m_hoveredEntityId;

+ 3 - 3
app/models/selected_units_model.cpp

@@ -39,7 +39,7 @@ auto SelectedUnitsModel::data(const QModelIndex &index,
   if (role == UnitIdRole) {
     return QVariant::fromValue<int>(static_cast<int>(id));
   }
-  if (!m_engine->getUnitInfo(id, name, hp, max_hp, is_b, alive, nation)) {
+  if (!m_engine->get_unit_info(id, name, hp, max_hp, is_b, alive, nation)) {
     return {};
   }
   if (role == NameRole) {
@@ -76,7 +76,7 @@ void SelectedUnitsModel::refresh() {
     return;
   }
   std::vector<Engine::Core::EntityID> ids;
-  m_engine->getSelectedUnitIds(ids);
+  m_engine->get_selected_unit_ids(ids);
 
   if (ids.size() == m_ids.size() &&
       std::equal(ids.begin(), ids.end(), m_ids.begin())) {
@@ -99,7 +99,7 @@ void SelectedUnitsModel::refresh() {
     int max_hp = 0;
     bool is_b = false;
     bool alive = false;
-    if (!m_engine->getUnitInfo(id, nm, hp, max_hp, is_b, alive, nation)) {
+    if (!m_engine->get_unit_info(id, nm, hp, max_hp, is_b, alive, nation)) {
       continue;
     }
     if (is_b) {

+ 14 - 14
app/utils/engine_view_helpers.h

@@ -8,34 +8,34 @@
 
 namespace App::Utils {
 
-inline auto screenToGround(const Game::Systems::PickingService *pickingService,
-                           const Render::GL::Camera *camera,
-                           QQuickWindow *window, int viewportWidth,
-                           int viewportHeight, const QPointF &screenPt,
-                           QVector3D &outWorld) -> bool {
+inline auto
+screen_to_ground(const Game::Systems::PickingService *pickingService,
+                 const Render::GL::Camera *camera, QQuickWindow *window,
+                 int viewportWidth, int viewportHeight, const QPointF &screenPt,
+                 QVector3D &outWorld) -> bool {
   if ((window == nullptr) || (camera == nullptr) ||
       (pickingService == nullptr)) {
     return false;
   }
   int const w = (viewportWidth > 0 ? viewportWidth : window->width());
   int const h = (viewportHeight > 0 ? viewportHeight : window->height());
-  return Game::Systems::PickingService::screenToGround(*camera, w, h, screenPt,
-                                                       outWorld);
+  return Game::Systems::PickingService::screen_to_ground(*camera, w, h,
+                                                         screenPt, outWorld);
 }
 
-inline auto worldToScreen(const Game::Systems::PickingService *pickingService,
-                          const Render::GL::Camera *camera,
-                          QQuickWindow *window, int viewportWidth,
-                          int viewportHeight, const QVector3D &world,
-                          QPointF &outScreen) -> bool {
+inline auto world_to_screen(const Game::Systems::PickingService *pickingService,
+                            const Render::GL::Camera *camera,
+                            QQuickWindow *window, int viewportWidth,
+                            int viewportHeight, const QVector3D &world,
+                            QPointF &outScreen) -> bool {
   if ((window == nullptr) || (camera == nullptr) ||
       (pickingService == nullptr)) {
     return false;
   }
   int const w = (viewportWidth > 0 ? viewportWidth : window->width());
   int const h = (viewportHeight > 0 ? viewportHeight : window->height());
-  return Game::Systems::PickingService::worldToScreen(*camera, w, h, world,
-                                                      outScreen);
+  return Game::Systems::PickingService::world_to_screen(*camera, w, h, world,
+                                                        outScreen);
 }
 
 } // namespace App::Utils

+ 11 - 11
app/utils/movement_utils.h

@@ -5,32 +5,32 @@
 
 namespace App::Utils {
 
-inline void resetMovement(Engine::Core::Entity *entity) {
+inline void reset_movement(Engine::Core::Entity *entity) {
   if (entity == nullptr) {
     return;
   }
 
-  auto *movement = entity->getComponent<Engine::Core::MovementComponent>();
+  auto *movement = entity->get_component<Engine::Core::MovementComponent>();
   if (movement == nullptr) {
     return;
   }
 
-  auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
-  movement->hasTarget = false;
+  auto *transform = entity->get_component<Engine::Core::TransformComponent>();
+  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;
   }
 }
 

+ 7 - 7
app/utils/selection_utils.h

@@ -10,17 +10,17 @@
 namespace App::Utils {
 
 inline void
-sanitizeSelection(Engine::Core::World *world,
-                  Game::Systems::SelectionSystem *selection_system) {
+sanitize_selection(Engine::Core::World *world,
+                   Game::Systems::SelectionSystem *selection_system) {
   if ((world == nullptr) || (selection_system == nullptr)) {
     return;
   }
-  const auto &sel = selection_system->getSelectedUnits();
+  const auto &sel = selection_system->get_selected_units();
   std::vector<Engine::Core::EntityID> toKeep;
   toKeep.reserve(sel.size());
   for (auto id : sel) {
-    if (auto *e = world->getEntity(id)) {
-      if (auto *u = e->getComponent<Engine::Core::UnitComponent>()) {
+    if (auto *e = world->get_entity(id)) {
+      if (auto *u = e->get_component<Engine::Core::UnitComponent>()) {
         if (u->health > 0) {
           toKeep.push_back(id);
         }
@@ -29,9 +29,9 @@ sanitizeSelection(Engine::Core::World *world,
   }
   if (toKeep.size() != sel.size() ||
       !std::equal(toKeep.begin(), toKeep.end(), sel.begin())) {
-    selection_system->clearSelection();
+    selection_system->clear_selection();
     for (auto id : toKeep) {
-      selection_system->selectUnit(id);
+      selection_system->select_unit(id);
     }
   }
 }

+ 8 - 8
game/audio/AudioEventHandler.cpp

@@ -65,13 +65,13 @@ void AudioEventHandler::shutdown() {
 }
 
 void AudioEventHandler::loadUnitVoiceMapping(const std::string &unit_type,
-                                             const std::string &soundId) {
-  m_unitVoiceMap[unit_type] = soundId;
+                                             const std::string &sound_id) {
+  m_unitVoiceMap[unit_type] = sound_id;
 }
 
 void AudioEventHandler::loadAmbientMusic(Engine::Core::AmbientState state,
-                                         const std::string &musicId) {
-  m_ambientMusicMap[state] = musicId;
+                                         const std::string &music_id) {
+  m_ambientMusicMap[state] = music_id;
 }
 
 void AudioEventHandler::setVoiceSoundCategory(bool useVoiceCategory) {
@@ -84,12 +84,12 @@ void AudioEventHandler::onUnitSelected(
     return;
   }
 
-  auto *entity = m_world->getEntity(event.unit_id);
+  auto *entity = m_world->get_entity(event.unit_id);
   if (entity == nullptr) {
     return;
   }
 
-  auto *unit_component = entity->getComponent<Engine::Core::UnitComponent>();
+  auto *unit_component = entity->get_component<Engine::Core::UnitComponent>();
   if (unit_component == nullptr) {
     return;
   }
@@ -130,13 +130,13 @@ void AudioEventHandler::onAmbientStateChanged(
 
 void AudioEventHandler::onAudioTrigger(
     const Engine::Core::AudioTriggerEvent &event) {
-  AudioSystem::getInstance().playSound(event.soundId, event.volume, event.loop,
+  AudioSystem::getInstance().playSound(event.sound_id, event.volume, event.loop,
                                        event.priority);
 }
 
 void AudioEventHandler::onMusicTrigger(
     const Engine::Core::MusicTriggerEvent &event) {
-  AudioSystem::getInstance().playMusic(event.musicId, event.volume,
+  AudioSystem::getInstance().playMusic(event.music_id, event.volume,
                                        event.crossfade);
 }
 

+ 2 - 2
game/audio/AudioEventHandler.h

@@ -26,9 +26,9 @@ public:
   void shutdown();
 
   void loadUnitVoiceMapping(const std::string &unit_type,
-                            const std::string &soundId);
+                            const std::string &sound_id);
   void loadAmbientMusic(Engine::Core::AmbientState state,
-                        const std::string &musicId);
+                        const std::string &music_id);
 
   void setVoiceSoundCategory(bool useVoiceCategory);
 

+ 19 - 19
game/audio/AudioSystem.cpp

@@ -75,23 +75,23 @@ void AudioSystem::shutdown() {
   }
 }
 
-void AudioSystem::playSound(const std::string &soundId, float volume, bool loop,
-                            int priority, AudioCategory category) {
+void AudioSystem::playSound(const std::string &sound_id, float volume,
+                            bool loop, int priority, AudioCategory category) {
   std::lock_guard<std::mutex> const lock(queueMutex);
-  eventQueue.emplace(AudioEventType::PLAY_SOUND, soundId, volume, loop,
+  eventQueue.emplace(AudioEventType::PLAY_SOUND, sound_id, volume, loop,
                      priority, category);
   queueCondition.notify_one();
 }
 
-void AudioSystem::playMusic(const std::string &musicId, float volume, bool) {
+void AudioSystem::playMusic(const std::string &music_id, float volume, bool) {
   std::lock_guard<std::mutex> const lock(queueMutex);
-  eventQueue.emplace(AudioEventType::PLAY_MUSIC, musicId, volume);
+  eventQueue.emplace(AudioEventType::PLAY_MUSIC, music_id, volume);
   queueCondition.notify_one();
 }
 
-void AudioSystem::stopSound(const std::string &soundId) {
+void AudioSystem::stopSound(const std::string &sound_id) {
   std::lock_guard<std::mutex> const lock(queueMutex);
-  eventQueue.emplace(AudioEventType::STOP_SOUND, soundId);
+  eventQueue.emplace(AudioEventType::STOP_SOUND, sound_id);
   queueCondition.notify_one();
 }
 
@@ -169,11 +169,11 @@ void AudioSystem::resumeAll() {
   queueCondition.notify_one();
 }
 
-auto AudioSystem::loadSound(const std::string &soundId,
+auto AudioSystem::loadSound(const std::string &sound_id,
                             const std::string &filePath,
                             AudioCategory category) -> bool {
   std::lock_guard<std::mutex> const lock(resourceMutex);
-  if (sounds.find(soundId) != sounds.end()) {
+  if (sounds.find(sound_id) != sounds.end()) {
     return true;
   }
 
@@ -184,13 +184,13 @@ auto AudioSystem::loadSound(const std::string &soundId,
     return false;
   }
 
-  sounds[soundId] = std::move(sound);
-  soundCategories[soundId] = category;
-  activeResources.insert(soundId);
+  sounds[sound_id] = std::move(sound);
+  soundCategories[sound_id] = category;
+  activeResources.insert(sound_id);
   return true;
 }
 
-auto AudioSystem::loadMusic(const std::string &musicId,
+auto AudioSystem::loadMusic(const std::string &music_id,
                             const std::string &filePath) -> bool {
   std::lock_guard<std::mutex> const lock(resourceMutex);
 
@@ -199,20 +199,20 @@ auto AudioSystem::loadMusic(const std::string &musicId,
     return false;
   }
 
-  m_musicPlayer->registerTrack(musicId, filePath);
-  activeResources.insert(musicId);
+  m_musicPlayer->registerTrack(music_id, filePath);
+  activeResources.insert(music_id);
   return true;
 }
 
-void AudioSystem::unloadSound(const std::string &soundId) {
+void AudioSystem::unloadSound(const std::string &sound_id) {
   std::lock_guard<std::mutex> const lock(queueMutex);
-  eventQueue.emplace(AudioEventType::UNLOAD_RESOURCE, soundId);
+  eventQueue.emplace(AudioEventType::UNLOAD_RESOURCE, sound_id);
   queueCondition.notify_one();
 }
 
-void AudioSystem::unloadMusic(const std::string &musicId) {
+void AudioSystem::unloadMusic(const std::string &music_id) {
   std::lock_guard<std::mutex> const lock(queueMutex);
-  eventQueue.emplace(AudioEventType::UNLOAD_RESOURCE, musicId);
+  eventQueue.emplace(AudioEventType::UNLOAD_RESOURCE, music_id);
   queueCondition.notify_one();
 }
 

+ 7 - 7
game/audio/AudioSystem.h

@@ -58,15 +58,15 @@ public:
   auto initialize() -> bool;
   void shutdown();
 
-  void playSound(const std::string &soundId,
+  void playSound(const std::string &sound_id,
                  float volume = AudioConstants::DEFAULT_VOLUME,
                  bool loop = false,
                  int priority = AudioConstants::DEFAULT_PRIORITY,
                  AudioCategory category = AudioCategory::SFX);
-  void playMusic(const std::string &musicId,
+  void playMusic(const std::string &music_id,
                  float volume = AudioConstants::DEFAULT_VOLUME,
                  bool crossfade = true);
-  void stopSound(const std::string &soundId);
+  void stopSound(const std::string &sound_id);
   void stopMusic();
   void setMasterVolume(float volume);
   void setSoundVolume(float volume);
@@ -75,12 +75,12 @@ public:
   void pauseAll();
   void resumeAll();
 
-  auto loadSound(const std::string &soundId, const std::string &filePath,
+  auto loadSound(const std::string &sound_id, const std::string &filePath,
                  AudioCategory category = AudioCategory::SFX) -> bool;
-  auto loadMusic(const std::string &musicId,
+  auto loadMusic(const std::string &music_id,
                  const std::string &filePath) -> bool;
-  void unloadSound(const std::string &soundId);
-  void unloadMusic(const std::string &musicId);
+  void unloadSound(const std::string &sound_id);
+  void unloadMusic(const std::string &music_id);
   void unloadAllSounds();
   void unloadAllMusic();
 

+ 64 - 64
game/core/component.h

@@ -33,11 +33,11 @@ inline constexpr float kHoldStandUpDuration = 2.0F;
 class TransformComponent : public Component {
 public:
   TransformComponent(float x = 0.0F, float y = 0.0F, float z = 0.0F,
-                     float rotX = 0.0F, float rotY = 0.0F, float rotZ = 0.0F,
-                     float scale_x = 1.0F, float scaleY = 1.0F,
+                     float rot_x = 0.0F, float rot_y = 0.0F, float rot_z = 0.0F,
+                     float scale_x = 1.0F, float scale_y = 1.0F,
                      float scale_z = 1.0F)
-      : position{x, y, z}, rotation{rotX, rotY, rotZ},
-        scale{scale_x, scaleY, scale_z} {}
+      : position{x, y, z}, rotation{rot_x, rot_y, rot_z},
+        scale{scale_x, scale_y, scale_z} {}
 
   struct Vec3 {
     float x, y, z;
@@ -46,22 +46,22 @@ public:
   Vec3 rotation;
   Vec3 scale;
 
-  float desiredYaw = 0.0F;
-  bool hasDesiredYaw = false;
+  float desired_yaw = 0.0F;
+  bool has_desired_yaw = false;
 };
 
 class RenderableComponent : public Component {
 public:
   enum class MeshKind { None, Quad, Plane, Cube, Capsule, Ring };
 
-  RenderableComponent(std::string meshPath, std::string texturePath)
-      : meshPath(std::move(meshPath)), texturePath(std::move(texturePath)) {
+  RenderableComponent(std::string mesh_path, std::string texture_path)
+      : mesh_path(std::move(mesh_path)), texture_path(std::move(texture_path)) {
     color.fill(1.0F);
   }
 
-  std::string meshPath;
-  std::string texturePath;
-  std::string rendererId;
+  std::string mesh_path;
+  std::string texture_path;
+  std::string renderer_id;
   bool visible{true};
   MeshKind mesh{MeshKind::Cube};
   std::array<float, 3> color{};
@@ -89,17 +89,17 @@ class MovementComponent : public Component {
 public:
   MovementComponent() = default;
 
-  bool hasTarget{false};
+  bool has_target{false};
   float target_x{0.0F}, target_y{0.0F};
-  float goalX{0.0F}, goalY{0.0F};
+  float goal_x{0.0F}, goal_y{0.0F};
   float vx{0.0F}, vz{0.0F};
   std::vector<std::pair<float, float>> path;
-  bool pathPending{false};
-  std::uint64_t pendingRequestId{0};
-  float repathCooldown{0.0F};
+  bool path_pending{false};
+  std::uint64_t pending_request_id{0};
+  float repath_cooldown{0.0F};
 
-  float lastGoalX{0.0F}, lastGoalY{0.0F};
-  float timeSinceLastPathRequest{0.0F};
+  float last_goal_x{0.0F}, last_goal_y{0.0F};
+  float time_since_last_path_request{0.0F};
 };
 
 class AttackComponent : public Component {
@@ -110,49 +110,49 @@ public:
                   int damage = Defaults::kAttackDefaultDamage,
                   float cooldown = 1.0F)
       : range(range), damage(damage), cooldown(cooldown),
-        meleeRange(Defaults::kAttackMeleeRange), meleeDamage(damage),
-        meleeCooldown(cooldown),
-        max_heightDifference(Defaults::kAttackHeightTolerance) {}
+        melee_range(Defaults::kAttackMeleeRange), melee_damage(damage),
+        melee_cooldown(cooldown),
+        max_height_difference(Defaults::kAttackHeightTolerance) {}
 
   float range;
   int damage;
   float cooldown;
-  float timeSinceLast{0.0F};
+  float time_since_last{0.0F};
 
-  float meleeRange;
-  int meleeDamage;
-  float meleeCooldown;
+  float melee_range;
+  int melee_damage;
+  float melee_cooldown;
 
-  CombatMode preferredMode{CombatMode::Auto};
-  CombatMode currentMode{CombatMode::Ranged};
+  CombatMode preferred_mode{CombatMode::Auto};
+  CombatMode current_mode{CombatMode::Ranged};
 
-  bool canMelee{true};
-  bool canRanged{false};
+  bool can_melee{true};
+  bool can_ranged{false};
 
-  float max_heightDifference;
+  float max_height_difference;
 
-  bool inMeleeLock{false};
-  EntityID meleeLockTargetId{0};
+  bool in_melee_lock{false};
+  EntityID melee_lock_target_id{0};
 
-  [[nodiscard]] auto isInMeleeRange(float distance,
-                                    float height_diff) const -> bool {
-    return distance <= meleeRange && height_diff <= max_heightDifference;
+  [[nodiscard]] auto is_in_melee_range(float distance,
+                                       float height_diff) const -> bool {
+    return distance <= melee_range && height_diff <= max_height_difference;
   }
 
-  [[nodiscard]] auto isInRangedRange(float distance) const -> bool {
-    return distance <= range && distance > meleeRange;
+  [[nodiscard]] auto is_in_ranged_range(float distance) const -> bool {
+    return distance <= range && distance > melee_range;
   }
 
-  [[nodiscard]] auto getCurrentDamage() const -> int {
-    return (currentMode == CombatMode::Melee) ? meleeDamage : damage;
+  [[nodiscard]] auto get_current_damage() const -> int {
+    return (current_mode == CombatMode::Melee) ? melee_damage : damage;
   }
 
-  [[nodiscard]] auto getCurrentCooldown() const -> float {
-    return (currentMode == CombatMode::Melee) ? meleeCooldown : cooldown;
+  [[nodiscard]] auto get_current_cooldown() const -> float {
+    return (current_mode == CombatMode::Melee) ? melee_cooldown : cooldown;
   }
 
-  [[nodiscard]] auto getCurrentRange() const -> float {
-    return (currentMode == CombatMode::Melee) ? meleeRange : range;
+  [[nodiscard]] auto get_current_range() const -> float {
+    return (current_mode == CombatMode::Melee) ? melee_range : range;
   }
 };
 
@@ -161,7 +161,7 @@ public:
   AttackTargetComponent() = default;
 
   EntityID target_id{0};
-  bool shouldChase{false};
+  bool should_chase{false};
 };
 
 class PatrolComponent : public Component {
@@ -169,7 +169,7 @@ public:
   PatrolComponent() = default;
 
   std::vector<std::pair<float, float>> waypoints;
-  size_t currentWaypoint{0};
+  size_t current_waypoint{0};
   bool patrolling{false};
 };
 
@@ -185,20 +185,20 @@ public:
 class ProductionComponent : public Component {
 public:
   ProductionComponent()
-      : buildTime(Defaults::kProductionDefaultBuildTime),
+      : build_time(Defaults::kProductionDefaultBuildTime),
 
-        maxUnits(Defaults::kProductionMaxUnits) {}
+        max_units(Defaults::kProductionMaxUnits) {}
 
-  bool inProgress{false};
-  float buildTime;
-  float timeRemaining{0.0F};
-  int producedCount{0};
-  int maxUnits;
+  bool in_progress{false};
+  float build_time;
+  float time_remaining{0.0F};
+  int produced_count{0};
+  int max_units;
   Game::Units::TroopType product_type{Game::Units::TroopType::Archer};
-  float rallyX{0.0F}, rallyZ{0.0F};
-  bool rallySet{false};
-  int villagerCost{1};
-  std::vector<Game::Units::TroopType> productionQueue;
+  float rally_x{0.0F}, rally_z{0.0F};
+  bool rally_set{false};
+  int villager_cost{1};
+  std::vector<Game::Units::TroopType> production_queue;
 };
 
 class AIControlledComponent : public Component {
@@ -208,12 +208,12 @@ public:
 
 class CaptureComponent : public Component {
 public:
-  CaptureComponent() : requiredTime(Defaults::kCaptureRequiredTime) {}
+  CaptureComponent() : required_time(Defaults::kCaptureRequiredTime) {}
 
   int capturing_player_id{-1};
-  float captureProgress{0.0F};
-  float requiredTime;
-  bool isBeingCaptured{false};
+  float capture_progress{0.0F};
+  float required_time;
+  bool is_being_captured{false};
 };
 
 class PendingRemovalComponent : public Component {
@@ -223,11 +223,11 @@ public:
 
 class HoldModeComponent : public Component {
 public:
-  HoldModeComponent() : standUpDuration(Defaults::kHoldStandUpDuration) {}
+  HoldModeComponent() : stand_up_duration(Defaults::kHoldStandUpDuration) {}
 
   bool active{true};
-  float exitCooldown{0.0F};
-  float standUpDuration;
+  float exit_cooldown{0.0F};
+  float stand_up_duration;
 };
 
 class HealerComponent : public Component {
@@ -237,7 +237,7 @@ public:
   float healing_range{8.0F};
   int healing_amount{5};
   float healing_cooldown{2.0F};
-  float timeSinceLastHeal{0.0F};
+  float time_since_last_heal{0.0F};
 };
 
 } // namespace Engine::Core

+ 1 - 1
game/core/entity.cpp

@@ -4,6 +4,6 @@ namespace Engine::Core {
 
 Entity::Entity(EntityID id) : m_id(id) {}
 
-auto Entity::getId() const -> EntityID { return m_id; }
+auto Entity::get_id() const -> EntityID { return m_id; }
 
 } // namespace Engine::Core

+ 6 - 6
game/core/entity.h

@@ -21,10 +21,10 @@ class Entity {
 public:
   Entity(EntityID id);
 
-  auto getId() const -> EntityID;
+  auto get_id() const -> EntityID;
 
   template <typename T, typename... Args>
-  auto addComponent(Args &&...args) -> T * {
+  auto add_component(Args &&...args) -> T * {
     static_assert(std::is_base_of_v<Component, T>,
                   "T must inherit from Component");
     auto component = std::make_unique<T>(std::forward<Args>(args)...);
@@ -33,7 +33,7 @@ public:
     return ptr;
   }
 
-  template <typename T> auto getComponent() -> T * {
+  template <typename T> auto get_component() -> T * {
     auto it = m_components.find(std::type_index(typeid(T)));
     if (it != m_components.end()) {
       return static_cast<T *>(it->second.get());
@@ -41,7 +41,7 @@ public:
     return nullptr;
   }
 
-  template <typename T> auto getComponent() const -> const T * {
+  template <typename T> auto get_component() const -> const T * {
     auto it = m_components.find(std::type_index(typeid(T)));
     if (it != m_components.end()) {
       return static_cast<const T *>(it->second.get());
@@ -49,11 +49,11 @@ public:
     return nullptr;
   }
 
-  template <typename T> void removeComponent() {
+  template <typename T> void remove_component() {
     m_components.erase(std::type_index(typeid(T)));
   }
 
-  template <typename T> auto hasComponent() const -> bool {
+  template <typename T> auto has_component() const -> bool {
     return m_components.find(std::type_index(typeid(T))) != m_components.end();
   }
 

+ 23 - 23
game/core/event_manager.h

@@ -16,7 +16,7 @@ namespace Engine::Core {
 class Event {
 public:
   virtual ~Event() = default;
-  [[nodiscard]] virtual auto getTypeName() const -> const char * {
+  [[nodiscard]] virtual auto get_type_name() const -> const char * {
     return "Event";
   }
 };
@@ -26,8 +26,8 @@ template <typename T> using EventHandler = std::function<void(const T &)>;
 using SubscriptionHandle = std::size_t;
 
 struct EventStats {
-  size_t publishCount = 0;
-  size_t subscriberCount = 0;
+  size_t publish_count = 0;
+  size_t subscriber_count = 0;
 };
 
 class EventManager {
@@ -49,7 +49,7 @@ public:
     HandlerEntry const entry{handle, wrapper};
     m_handlers[std::type_index(typeid(T))].push_back(entry);
 
-    m_stats[std::type_index(typeid(T))].subscriberCount++;
+    m_stats[std::type_index(typeid(T))].subscriber_count++;
 
     return handle;
   }
@@ -69,7 +69,7 @@ public:
                      handlers.end());
 
       if (handlers.size() < sizeBefore) {
-        m_stats[std::type_index(typeid(T))].subscriberCount--;
+        m_stats[std::type_index(typeid(T))].subscriber_count--;
       }
     }
   }
@@ -83,7 +83,7 @@ public:
       auto it = m_handlers.find(std::type_index(typeid(T)));
       if (it != m_handlers.end()) {
         handlersCopy = it->second;
-        m_stats[std::type_index(typeid(T))].publishCount++;
+        m_stats[std::type_index(typeid(T))].publish_count++;
       }
     }
 
@@ -92,25 +92,25 @@ public:
     }
   }
 
-  auto getStats(const std::type_index &eventType) const -> EventStats {
+  auto get_stats(const std::type_index &event_type) const -> EventStats {
     std::lock_guard<std::mutex> const lock(m_mutex);
-    auto it = m_stats.find(eventType);
+    auto it = m_stats.find(event_type);
     if (it != m_stats.end()) {
       return it->second;
     }
     return EventStats{};
   }
 
-  auto getSubscriberCount(const std::type_index &eventType) const -> size_t {
+  auto get_subscriber_count(const std::type_index &event_type) const -> size_t {
     std::lock_guard<std::mutex> const lock(m_mutex);
-    auto it = m_handlers.find(eventType);
+    auto it = m_handlers.find(event_type);
     if (it != m_handlers.end()) {
       return it->second.size();
     }
     return 0;
   }
 
-  void clearAllSubscriptions() {
+  void clear_all_subscriptions() {
     std::lock_guard<std::mutex> const lock(m_mutex);
     m_handlers.clear();
     m_stats.clear();
@@ -171,7 +171,7 @@ class UnitSelectedEvent : public Event {
 public:
   UnitSelectedEvent(EntityID unit_id) : unit_id(unit_id) {}
   EntityID unit_id;
-  [[nodiscard]] auto getTypeName() const -> const char * override {
+  [[nodiscard]] auto get_type_name() const -> const char * override {
     return "UNIT_SELECTED";
   }
 };
@@ -228,12 +228,12 @@ public:
 class BarrackCapturedEvent : public Event {
 public:
   BarrackCapturedEvent(EntityID barrackId, int previous_owner_id,
-                       int newOwnerId)
+                       int new_owner_id)
       : barrackId(barrackId), previous_owner_id(previous_owner_id),
-        newOwnerId(newOwnerId) {}
+        new_owner_id(new_owner_id) {}
   EntityID barrackId;
   int previous_owner_id;
-  int newOwnerId;
+  int new_owner_id;
 };
 
 enum class AmbientState { PEACEFUL, TENSE, COMBAT, VICTORY, DEFEAT };
@@ -244,18 +244,18 @@ public:
       : new_state(new_state), previous_state(previous_state) {}
   AmbientState new_state;
   AmbientState previous_state;
-  [[nodiscard]] auto getTypeName() const -> const char * override {
+  [[nodiscard]] auto get_type_name() const -> const char * override {
     return "AMBIENT_STATE_CHANGED";
   }
 };
 
 class AudioTriggerEvent : public Event {
 public:
-  AudioTriggerEvent(std::string soundId, float volume = 1.0F, bool loop = false,
-                    int priority = 0)
-      : soundId(std::move(soundId)), volume(volume), loop(loop),
+  AudioTriggerEvent(std::string sound_id, float volume = 1.0F,
+                    bool loop = false, int priority = 0)
+      : sound_id(std::move(sound_id)), volume(volume), loop(loop),
         priority(priority) {}
-  std::string soundId;
+  std::string sound_id;
   float volume;
   bool loop;
   int priority;
@@ -263,10 +263,10 @@ public:
 
 class MusicTriggerEvent : public Event {
 public:
-  MusicTriggerEvent(std::string musicId, float volume = 1.0F,
+  MusicTriggerEvent(std::string music_id, float volume = 1.0F,
                     bool crossfade = true)
-      : musicId(std::move(musicId)), volume(volume), crossfade(crossfade) {}
-  std::string musicId;
+      : music_id(std::move(music_id)), volume(volume), crossfade(crossfade) {}
+  std::string music_id;
   float volume;
   bool crossfade;
 };

+ 156 - 153
game/core/serialization.cpp

@@ -77,32 +77,32 @@ void deserializeColor(const QJsonArray &array, std::array<float, 3> &color) {
 
 auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
   QJsonObject entity_obj;
-  entity_obj["id"] = static_cast<qint64>(entity->getId());
+  entity_obj["id"] = static_cast<qint64>(entity->get_id());
 
-  if (const auto *transform = entity->getComponent<TransformComponent>()) {
+  if (const auto *transform = entity->get_component<TransformComponent>()) {
     QJsonObject transform_obj;
-    transform_obj["posX"] = transform->position.x;
-    transform_obj["posY"] = transform->position.y;
-    transform_obj["posZ"] = transform->position.z;
-    transform_obj["rotX"] = transform->rotation.x;
-    transform_obj["rotY"] = transform->rotation.y;
-    transform_obj["rotZ"] = transform->rotation.z;
+    transform_obj["pos_x"] = transform->position.x;
+    transform_obj["pos_y"] = transform->position.y;
+    transform_obj["pos_z"] = transform->position.z;
+    transform_obj["rot_x"] = transform->rotation.x;
+    transform_obj["rot_y"] = transform->rotation.y;
+    transform_obj["rot_z"] = transform->rotation.z;
     transform_obj["scale_x"] = transform->scale.x;
-    transform_obj["scaleY"] = transform->scale.y;
+    transform_obj["scale_y"] = transform->scale.y;
     transform_obj["scale_z"] = transform->scale.z;
-    transform_obj["hasDesiredYaw"] = transform->hasDesiredYaw;
-    transform_obj["desiredYaw"] = transform->desiredYaw;
+    transform_obj["has_desired_yaw"] = transform->has_desired_yaw;
+    transform_obj["desired_yaw"] = transform->desired_yaw;
     entity_obj["transform"] = transform_obj;
   }
 
-  if (const auto *renderable = entity->getComponent<RenderableComponent>()) {
+  if (const auto *renderable = entity->get_component<RenderableComponent>()) {
     QJsonObject renderable_obj;
-    renderable_obj["meshPath"] = QString::fromStdString(renderable->meshPath);
-    renderable_obj["texturePath"] =
-        QString::fromStdString(renderable->texturePath);
-    if (!renderable->rendererId.empty()) {
-      renderable_obj["rendererId"] =
-          QString::fromStdString(renderable->rendererId);
+    renderable_obj["mesh_path"] = QString::fromStdString(renderable->mesh_path);
+    renderable_obj["texture_path"] =
+        QString::fromStdString(renderable->texture_path);
+    if (!renderable->renderer_id.empty()) {
+      renderable_obj["renderer_id"] =
+          QString::fromStdString(renderable->renderer_id);
     }
     renderable_obj["visible"] = renderable->visible;
     renderable_obj["mesh"] = static_cast<int>(renderable->mesh);
@@ -110,7 +110,7 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     entity_obj["renderable"] = renderable_obj;
   }
 
-  if (const auto *unit = entity->getComponent<UnitComponent>()) {
+  if (const auto *unit = entity->get_component<UnitComponent>()) {
     QJsonObject unit_obj;
     unit_obj["health"] = unit->health;
     unit_obj["max_health"] = unit->max_health;
@@ -123,23 +123,23 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     entity_obj["unit"] = unit_obj;
   }
 
-  if (const auto *movement = entity->getComponent<MovementComponent>()) {
+  if (const auto *movement = entity->get_component<MovementComponent>()) {
     QJsonObject movement_obj;
-    movement_obj["hasTarget"] = movement->hasTarget;
+    movement_obj["has_target"] = 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["goal_x"] = movement->goal_x;
+    movement_obj["goal_y"] = movement->goal_y;
     movement_obj["vx"] = movement->vx;
     movement_obj["vz"] = movement->vz;
-    movement_obj["pathPending"] = movement->pathPending;
-    movement_obj["pendingRequestId"] =
-        static_cast<qint64>(movement->pendingRequestId);
-    movement_obj["repathCooldown"] = movement->repathCooldown;
-    movement_obj["lastGoalX"] = movement->lastGoalX;
-    movement_obj["lastGoalY"] = movement->lastGoalY;
-    movement_obj["timeSinceLastPathRequest"] =
-        movement->timeSinceLastPathRequest;
+    movement_obj["path_pending"] = movement->path_pending;
+    movement_obj["pending_request_id"] =
+        static_cast<qint64>(movement->pending_request_id);
+    movement_obj["repath_cooldown"] = movement->repath_cooldown;
+    movement_obj["last_goal_x"] = movement->last_goal_x;
+    movement_obj["last_goal_y"] = movement->last_goal_y;
+    movement_obj["time_since_last_path_request"] =
+        movement->time_since_last_path_request;
 
     QJsonArray path_array;
     for (const auto &waypoint : movement->path) {
@@ -152,38 +152,38 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     entity_obj["movement"] = movement_obj;
   }
 
-  if (const auto *attack = entity->getComponent<AttackComponent>()) {
+  if (const auto *attack = entity->get_component<AttackComponent>()) {
     QJsonObject attack_obj;
     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["meleeLockTargetId"] =
-        static_cast<qint64>(attack->meleeLockTargetId);
+    attack_obj["time_since_last"] = attack->time_since_last;
+    attack_obj["melee_range"] = attack->melee_range;
+    attack_obj["melee_damage"] = attack->melee_damage;
+    attack_obj["melee_cooldown"] = attack->melee_cooldown;
+    attack_obj["preferred_mode"] = combatModeToString(attack->preferred_mode);
+    attack_obj["current_mode"] = combatModeToString(attack->current_mode);
+    attack_obj["can_melee"] = attack->can_melee;
+    attack_obj["can_ranged"] = attack->can_ranged;
+    attack_obj["max_height_difference"] = attack->max_height_difference;
+    attack_obj["in_melee_lock"] = attack->in_melee_lock;
+    attack_obj["melee_lock_target_id"] =
+        static_cast<qint64>(attack->melee_lock_target_id);
     entity_obj["attack"] = attack_obj;
   }
 
   if (const auto *attack_target =
-          entity->getComponent<AttackTargetComponent>()) {
+          entity->get_component<AttackTargetComponent>()) {
     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["should_chase"] = attack_target->should_chase;
     entity_obj["attack_target"] = attack_target_obj;
   }
 
-  if (const auto *patrol = entity->getComponent<PatrolComponent>()) {
+  if (const auto *patrol = entity->get_component<PatrolComponent>()) {
     QJsonObject patrol_obj;
-    patrol_obj["currentWaypoint"] = static_cast<int>(patrol->currentWaypoint);
+    patrol_obj["current_waypoint"] = static_cast<int>(patrol->current_waypoint);
     patrol_obj["patrolling"] = patrol->patrolling;
 
     QJsonArray waypoints_array;
@@ -197,26 +197,26 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     entity_obj["patrol"] = patrol_obj;
   }
 
-  if (entity->getComponent<BuildingComponent>() != nullptr) {
+  if (entity->get_component<BuildingComponent>() != nullptr) {
     entity_obj["building"] = true;
   }
 
-  if (const auto *production = entity->getComponent<ProductionComponent>()) {
+  if (const auto *production = entity->get_component<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["in_progress"] = production->in_progress;
+    production_obj["build_time"] = production->build_time;
+    production_obj["time_remaining"] = production->time_remaining;
+    production_obj["produced_count"] = production->produced_count;
+    production_obj["max_units"] = 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["rally_x"] = production->rally_x;
+    production_obj["rally_z"] = production->rally_z;
+    production_obj["rally_set"] = production->rally_set;
+    production_obj["villager_cost"] = 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)));
     }
@@ -224,17 +224,17 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     entity_obj["production"] = production_obj;
   }
 
-  if (entity->getComponent<AIControlledComponent>() != nullptr) {
+  if (entity->get_component<AIControlledComponent>() != nullptr) {
     entity_obj["aiControlled"] = true;
   }
 
-  if (const auto *capture = entity->getComponent<CaptureComponent>()) {
+  if (const auto *capture = entity->get_component<CaptureComponent>()) {
     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;
+    capture_obj["capture_progress"] =
+        static_cast<double>(capture->capture_progress);
+    capture_obj["required_time"] = static_cast<double>(capture->required_time);
+    capture_obj["is_being_captured"] = capture->is_being_captured;
     entity_obj["capture"] = capture_obj;
   }
 
@@ -244,37 +244,39 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
 void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
   if (json.contains("transform")) {
     const auto transform_obj = json["transform"].toObject();
-    auto *transform = entity->addComponent<TransformComponent>();
+    auto *transform = entity->add_component<TransformComponent>();
     transform->position.x =
-        static_cast<float>(transform_obj["posX"].toDouble());
+        static_cast<float>(transform_obj["pos_x"].toDouble());
     transform->position.y =
-        static_cast<float>(transform_obj["posY"].toDouble());
+        static_cast<float>(transform_obj["pos_y"].toDouble());
     transform->position.z =
-        static_cast<float>(transform_obj["posZ"].toDouble());
+        static_cast<float>(transform_obj["pos_z"].toDouble());
     transform->rotation.x =
-        static_cast<float>(transform_obj["rotX"].toDouble());
+        static_cast<float>(transform_obj["rot_x"].toDouble());
     transform->rotation.y =
-        static_cast<float>(transform_obj["rotY"].toDouble());
+        static_cast<float>(transform_obj["rot_y"].toDouble());
     transform->rotation.z =
-        static_cast<float>(transform_obj["rotZ"].toDouble());
+        static_cast<float>(transform_obj["rot_z"].toDouble());
     transform->scale.x =
         static_cast<float>(transform_obj["scale_x"].toDouble());
-    transform->scale.y = static_cast<float>(transform_obj["scaleY"].toDouble());
+    transform->scale.y =
+        static_cast<float>(transform_obj["scale_y"].toDouble());
     transform->scale.z =
         static_cast<float>(transform_obj["scale_z"].toDouble());
-    transform->hasDesiredYaw = transform_obj["hasDesiredYaw"].toBool(false);
-    transform->desiredYaw =
-        static_cast<float>(transform_obj["desiredYaw"].toDouble());
+    transform->has_desired_yaw = transform_obj["has_desired_yaw"].toBool(false);
+    transform->desired_yaw =
+        static_cast<float>(transform_obj["desired_yaw"].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_obj["texturePath"].toString().toStdString();
-    renderable->rendererId =
-        renderable_obj["rendererId"].toString().toStdString();
+    auto *renderable = entity->add_component<RenderableComponent>("", "");
+    renderable->mesh_path =
+        renderable_obj["mesh_path"].toString().toStdString();
+    renderable->texture_path =
+        renderable_obj["texture_path"].toString().toStdString();
+    renderable->renderer_id =
+        renderable_obj["renderer_id"].toString().toStdString();
     renderable->visible = renderable_obj["visible"].toBool(true);
     renderable->mesh =
         static_cast<RenderableComponent::MeshKind>(renderable_obj["mesh"].toInt(
@@ -286,7 +288,7 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
 
   if (json.contains("unit")) {
     const auto unit_obj = json["unit"].toObject();
-    auto *unit = entity->addComponent<UnitComponent>();
+    auto *unit = entity->add_component<UnitComponent>();
     unit->health = unit_obj["health"].toInt(Defaults::kUnitDefaultHealth);
     unit->max_health =
         unit_obj["max_health"].toInt(Defaults::kUnitDefaultHealth);
@@ -320,27 +322,27 @@ 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);
+    auto *movement = entity->add_component<MovementComponent>();
+    movement->has_target = movement_obj["has_target"].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["goal_x"].toDouble());
+    movement->goal_y = static_cast<float>(movement_obj["goal_y"].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_obj["pendingRequestId"].toVariant().toULongLong());
-    movement->repathCooldown =
-        static_cast<float>(movement_obj["repathCooldown"].toDouble());
-    movement->lastGoalX =
-        static_cast<float>(movement_obj["lastGoalX"].toDouble());
-    movement->lastGoalY =
-        static_cast<float>(movement_obj["lastGoalY"].toDouble());
-    movement->timeSinceLastPathRequest =
-        static_cast<float>(movement_obj["timeSinceLastPathRequest"].toDouble());
+    movement->path_pending = movement_obj["path_pending"].toBool(false);
+    movement->pending_request_id = static_cast<std::uint64_t>(
+        movement_obj["pending_request_id"].toVariant().toULongLong());
+    movement->repath_cooldown =
+        static_cast<float>(movement_obj["repath_cooldown"].toDouble());
+    movement->last_goal_x =
+        static_cast<float>(movement_obj["last_goal_x"].toDouble());
+    movement->last_goal_y =
+        static_cast<float>(movement_obj["last_goal_y"].toDouble());
+    movement->time_since_last_path_request = static_cast<float>(
+        movement_obj["time_since_last_path_request"].toDouble());
 
     movement->path.clear();
     const auto path_array = movement_obj["path"].toArray();
@@ -355,44 +357,45 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
 
   if (json.contains("attack")) {
     const auto attack_obj = json["attack"].toObject();
-    auto *attack = entity->addComponent<AttackComponent>();
+    auto *attack = entity->add_component<AttackComponent>();
     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 =
-        static_cast<float>(attack_obj["timeSinceLast"].toDouble());
-    attack->meleeRange = static_cast<float>(attack_obj["meleeRange"].toDouble(
+    attack->time_since_last =
+        static_cast<float>(attack_obj["time_since_last"].toDouble());
+    attack->melee_range = static_cast<float>(attack_obj["melee_range"].toDouble(
         static_cast<double>(Defaults::kAttackMeleeRange)));
-    attack->meleeDamage = attack_obj["meleeDamage"].toInt(0);
-    attack->meleeCooldown =
-        static_cast<float>(attack_obj["meleeCooldown"].toDouble());
-    attack->preferredMode =
-        combatModeFromString(attack_obj["preferredMode"].toString());
-    attack->currentMode =
-        combatModeFromString(attack_obj["currentMode"].toString());
-    attack->canMelee = attack_obj["canMelee"].toBool(true);
-    attack->canRanged = attack_obj["canRanged"].toBool(false);
-    attack->max_heightDifference =
-        static_cast<float>(attack_obj["max_heightDifference"].toDouble(
+    attack->melee_damage = attack_obj["melee_damage"].toInt(0);
+    attack->melee_cooldown =
+        static_cast<float>(attack_obj["melee_cooldown"].toDouble());
+    attack->preferred_mode =
+        combatModeFromString(attack_obj["preferred_mode"].toString());
+    attack->current_mode =
+        combatModeFromString(attack_obj["current_mode"].toString());
+    attack->can_melee = attack_obj["can_melee"].toBool(true);
+    attack->can_ranged = attack_obj["can_ranged"].toBool(false);
+    attack->max_height_difference =
+        static_cast<float>(attack_obj["max_height_difference"].toDouble(
             static_cast<double>(Defaults::kAttackHeightTolerance)));
-    attack->inMeleeLock = attack_obj["inMeleeLock"].toBool(false);
-    attack->meleeLockTargetId = static_cast<EntityID>(
-        attack_obj["meleeLockTargetId"].toVariant().toULongLong());
+    attack->in_melee_lock = attack_obj["in_melee_lock"].toBool(false);
+    attack->melee_lock_target_id = static_cast<EntityID>(
+        attack_obj["melee_lock_target_id"].toVariant().toULongLong());
   }
 
   if (json.contains("attack_target")) {
     const auto attack_target_obj = json["attack_target"].toObject();
-    auto *attack_target = entity->addComponent<AttackTargetComponent>();
+    auto *attack_target = entity->add_component<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["should_chase"].toBool(false);
   }
 
   if (json.contains("patrol")) {
     const auto patrol_obj = json["patrol"].toObject();
-    auto *patrol = entity->addComponent<PatrolComponent>();
-    patrol->currentWaypoint =
-        static_cast<size_t>(std::max(0, patrol_obj["currentWaypoint"].toInt()));
+    auto *patrol = entity->add_component<PatrolComponent>();
+    patrol->current_waypoint = static_cast<size_t>(
+        std::max(0, patrol_obj["current_waypoint"].toInt()));
     patrol->patrolling = patrol_obj["patrolling"].toBool(false);
 
     patrol->waypoints.clear();
@@ -407,51 +410,51 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
   }
 
   if (json.contains("building") && json["building"].toBool()) {
-    entity->addComponent<BuildingComponent>();
+    entity->add_component<BuildingComponent>();
   }
 
   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 =
-        static_cast<float>(production_obj["buildTime"].toDouble());
-    production->timeRemaining =
-        static_cast<float>(production_obj["timeRemaining"].toDouble());
-    production->producedCount = production_obj["producedCount"].toInt(0);
-    production->maxUnits = production_obj["maxUnits"].toInt(0);
+    auto *production = entity->add_component<ProductionComponent>();
+    production->in_progress = production_obj["in_progress"].toBool(false);
+    production->build_time =
+        static_cast<float>(production_obj["build_time"].toDouble());
+    production->time_remaining =
+        static_cast<float>(production_obj["time_remaining"].toDouble());
+    production->produced_count = production_obj["produced_count"].toInt(0);
+    production->max_units = production_obj["max_units"].toInt(0);
     production->product_type = Game::Units::troop_typeFromString(
         production_obj["product_type"].toString().toStdString());
-    production->rallyX =
-        static_cast<float>(production_obj["rallyX"].toDouble());
-    production->rallyZ =
-        static_cast<float>(production_obj["rallyZ"].toDouble());
-    production->rallySet = production_obj["rallySet"].toBool(false);
-    production->villagerCost = production_obj["villagerCost"].toInt(1);
-
-    production->productionQueue.clear();
+    production->rally_x =
+        static_cast<float>(production_obj["rally_x"].toDouble());
+    production->rally_z =
+        static_cast<float>(production_obj["rally_z"].toDouble());
+    production->rally_set = production_obj["rally_set"].toBool(false);
+    production->villager_cost = production_obj["villager_cost"].toInt(1);
+
+    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()));
     }
   }
 
   if (json.contains("aiControlled") && json["aiControlled"].toBool()) {
-    entity->addComponent<AIControlledComponent>();
+    entity->add_component<AIControlledComponent>();
   }
 
   if (json.contains("capture")) {
     const auto capture_obj = json["capture"].toObject();
-    auto *capture = entity->addComponent<CaptureComponent>();
+    auto *capture = entity->add_component<CaptureComponent>();
     capture->capturing_player_id = capture_obj["capturing_player_id"].toInt(-1);
-    capture->captureProgress =
-        static_cast<float>(capture_obj["captureProgress"].toDouble(0.0));
-    capture->requiredTime =
-        static_cast<float>(capture_obj["requiredTime"].toDouble(
+    capture->capture_progress =
+        static_cast<float>(capture_obj["capture_progress"].toDouble(0.0));
+    capture->required_time =
+        static_cast<float>(capture_obj["required_time"].toDouble(
             static_cast<double>(Defaults::kCaptureRequiredTime)));
-    capture->isBeingCaptured = capture_obj["isBeingCaptured"].toBool(false);
+    capture->is_being_captured = capture_obj["is_being_captured"].toBool(false);
   }
 }
 
@@ -776,14 +779,14 @@ auto Serialization::serializeWorld(const World *world) -> QJsonDocument {
   QJsonObject world_obj;
   QJsonArray entities_array;
 
-  const auto &entities = world->getEntities();
+  const auto &entities = world->get_entities();
   for (const auto &[id, entity] : entities) {
     QJsonObject const entity_obj = serializeEntity(entity.get());
     entities_array.append(entity_obj);
   }
 
   world_obj["entities"] = entities_array;
-  world_obj["nextEntityId"] = static_cast<qint64>(world->getNextEntityId());
+  world_obj["nextEntityId"] = static_cast<qint64>(world->get_next_entity_id());
   world_obj["schemaVersion"] = 1;
   world_obj["owner_registry"] =
       Game::Systems::OwnerRegistry::instance().toJson();
@@ -807,8 +810,8 @@ void Serialization::deserializeWorld(World *world, const QJsonDocument &doc) {
     const auto entity_id =
         static_cast<EntityID>(entity_obj["id"].toVariant().toULongLong());
     auto *entity = entity_id == NULL_ENTITY
-                       ? world->createEntity()
-                       : world->createEntityWithId(entity_id);
+                       ? world->create_entity()
+                       : world->create_entity_with_id(entity_id);
     if (entity != nullptr) {
       deserializeEntity(entity, entity_obj);
     }
@@ -817,7 +820,7 @@ void Serialization::deserializeWorld(World *world, const QJsonDocument &doc) {
   if (world_obj.contains("nextEntityId")) {
     const auto next_id = static_cast<EntityID>(
         world_obj["nextEntityId"].toVariant().toULongLong());
-    world->setNextEntityId(next_id);
+    world->set_next_entity_id(next_id);
   }
 
   if (world_obj.contains("owner_registry")) {

+ 1 - 1
game/core/system.h

@@ -14,7 +14,7 @@ public:
   auto operator=(const System &) -> System & = default;
   auto operator=(System &&) noexcept -> System & = default;
   virtual ~System() = default;
-  virtual void update(World *world, float deltaTime) = 0;
+  virtual void update(World *world, float delta_time) = 0;
 };
 
 } // namespace Engine::Core

+ 36 - 35
game/core/world.cpp

@@ -15,17 +15,17 @@ namespace Engine::Core {
 World::World() = default;
 World::~World() = default;
 
-auto World::createEntity() -> Entity * {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
-  EntityID const id = m_nextEntityId++;
+auto World::create_entity() -> Entity * {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
+  EntityID const id = m_next_entity_id++;
   auto entity = std::make_unique<Entity>(id);
   auto *ptr = entity.get();
   m_entities[id] = std::move(entity);
   return ptr;
 }
 
-auto World::createEntityWithId(EntityID entity_id) -> Entity * {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+auto World::create_entity_with_id(EntityID entity_id) -> Entity * {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   if (entity_id == NULL_ENTITY) {
     return nullptr;
   }
@@ -34,46 +34,46 @@ auto World::createEntityWithId(EntityID entity_id) -> Entity * {
   auto *ptr = entity.get();
   m_entities[entity_id] = std::move(entity);
 
-  if (entity_id >= m_nextEntityId) {
-    m_nextEntityId = entity_id + 1;
+  if (entity_id >= m_next_entity_id) {
+    m_next_entity_id = entity_id + 1;
   }
 
   return ptr;
 }
 
-void World::destroyEntity(EntityID entity_id) {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+void World::destroy_entity(EntityID entity_id) {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   m_entities.erase(entity_id);
 }
 
 void World::clear() {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   m_entities.clear();
-  m_nextEntityId = 1;
+  m_next_entity_id = 1;
 }
 
-auto World::getEntity(EntityID entity_id) -> Entity * {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+auto World::get_entity(EntityID entity_id) -> Entity * {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   auto it = m_entities.find(entity_id);
   return it != m_entities.end() ? it->second.get() : nullptr;
 }
 
-void World::addSystem(std::unique_ptr<System> system) {
+void World::add_system(std::unique_ptr<System> system) {
   m_systems.push_back(std::move(system));
 }
 
-void World::update(float deltaTime) {
+void World::update(float delta_time) {
   for (auto &system : m_systems) {
-    system->update(this, deltaTime);
+    system->update(this, delta_time);
   }
 }
 
-auto World::getUnitsOwnedBy(int owner_id) const -> std::vector<Entity *> {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+auto World::get_units_owned_by(int owner_id) const -> std::vector<Entity *> {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   std::vector<Entity *> result;
   result.reserve(m_entities.size());
   for (const auto &[entity_id, entity] : m_entities) {
-    auto *unit = entity->getComponent<UnitComponent>();
+    auto *unit = entity->get_component<UnitComponent>();
     if (unit == nullptr) {
       continue;
     }
@@ -84,12 +84,13 @@ auto World::getUnitsOwnedBy(int owner_id) const -> std::vector<Entity *> {
   return result;
 }
 
-auto World::getUnitsNotOwnedBy(int owner_id) const -> std::vector<Entity *> {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+auto World::get_units_not_owned_by(int owner_id) const
+    -> std::vector<Entity *> {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   std::vector<Entity *> result;
   result.reserve(m_entities.size());
   for (const auto &[entity_id, entity] : m_entities) {
-    auto *unit = entity->getComponent<UnitComponent>();
+    auto *unit = entity->get_component<UnitComponent>();
     if (unit == nullptr) {
       continue;
     }
@@ -100,14 +101,14 @@ auto World::getUnitsNotOwnedBy(int owner_id) const -> std::vector<Entity *> {
   return result;
 }
 
-auto World::getAlliedUnits(int owner_id) const -> std::vector<Entity *> {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+auto World::get_allied_units(int owner_id) const -> std::vector<Entity *> {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   std::vector<Entity *> result;
   result.reserve(m_entities.size());
   auto &owner_registry = Game::Systems::OwnerRegistry::instance();
 
   for (const auto &[entity_id, entity] : m_entities) {
-    auto *unit = entity->getComponent<UnitComponent>();
+    auto *unit = entity->get_component<UnitComponent>();
     if (unit == nullptr) {
       continue;
     }
@@ -120,14 +121,14 @@ auto World::getAlliedUnits(int owner_id) const -> std::vector<Entity *> {
   return result;
 }
 
-auto World::getEnemyUnits(int owner_id) const -> std::vector<Entity *> {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+auto World::get_enemy_units(int owner_id) const -> std::vector<Entity *> {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   std::vector<Entity *> result;
   result.reserve(m_entities.size());
   auto &owner_registry = Game::Systems::OwnerRegistry::instance();
 
   for (const auto &[entity_id, entity] : m_entities) {
-    auto *unit = entity->getComponent<UnitComponent>();
+    auto *unit = entity->get_component<UnitComponent>();
     if (unit == nullptr) {
       continue;
     }
@@ -139,18 +140,18 @@ auto World::getEnemyUnits(int owner_id) const -> std::vector<Entity *> {
   return result;
 }
 
-auto World::countTroopsForPlayer(int owner_id) -> int {
+auto World::count_troops_for_player(int owner_id) -> int {
   return Game::Systems::TroopCountRegistry::instance().getTroopCount(owner_id);
 }
 
-auto World::getNextEntityId() const -> EntityID {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
-  return m_nextEntityId;
+auto World::get_next_entity_id() const -> EntityID {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
+  return m_next_entity_id;
 }
 
-void World::setNextEntityId(EntityID next_id) {
-  const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
-  m_nextEntityId = std::max(next_id, m_nextEntityId);
+void World::set_next_entity_id(EntityID next_id) {
+  const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
+  m_next_entity_id = std::max(next_id, m_next_entity_id);
 }
 
 } // namespace Engine::Core

+ 21 - 21
game/core/world.h

@@ -19,18 +19,18 @@ public:
   auto operator=(const World &) -> World & = delete;
   auto operator=(World &&) -> World & = delete;
 
-  auto createEntity() -> Entity *;
-  auto createEntityWithId(EntityID entity_id) -> Entity *;
-  void destroyEntity(EntityID entity_id);
-  auto getEntity(EntityID entity_id) -> Entity *;
+  auto create_entity() -> Entity *;
+  auto create_entity_with_id(EntityID entity_id) -> Entity *;
+  void destroy_entity(EntityID entity_id);
+  auto get_entity(EntityID entity_id) -> Entity *;
   void clear();
 
-  void addSystem(std::unique_ptr<System> system);
-  void update(float deltaTime);
+  void add_system(std::unique_ptr<System> system);
+  void update(float delta_time);
 
   auto systems() -> std::vector<std::unique_ptr<System>> & { return m_systems; }
 
-  template <typename T> auto getSystem() -> T * {
+  template <typename T> auto get_system() -> T * {
     for (auto &system : m_systems) {
       if (auto *ptr = dynamic_cast<T *>(system.get())) {
         return ptr;
@@ -39,38 +39,38 @@ public:
     return nullptr;
   }
 
-  template <typename T> auto getEntitiesWith() -> std::vector<Entity *> {
-    const std::lock_guard<std::recursive_mutex> lock(m_entityMutex);
+  template <typename T> auto get_entities_with() -> std::vector<Entity *> {
+    const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
     std::vector<Entity *> result;
     for (auto &[entity_id, entity] : m_entities) {
-      if (entity->template hasComponent<T>()) {
+      if (entity->template has_component<T>()) {
         result.push_back(entity.get());
       }
     }
     return result;
   }
 
-  auto getUnitsOwnedBy(int owner_id) const -> std::vector<Entity *>;
-  auto getUnitsNotOwnedBy(int owner_id) const -> std::vector<Entity *>;
-  auto getAlliedUnits(int owner_id) const -> std::vector<Entity *>;
-  auto getEnemyUnits(int owner_id) const -> std::vector<Entity *>;
-  static auto countTroopsForPlayer(int owner_id) -> int;
+  auto get_units_owned_by(int owner_id) const -> std::vector<Entity *>;
+  auto get_units_not_owned_by(int owner_id) const -> std::vector<Entity *>;
+  auto get_allied_units(int owner_id) const -> std::vector<Entity *>;
+  auto get_enemy_units(int owner_id) const -> std::vector<Entity *>;
+  static auto count_troops_for_player(int owner_id) -> int;
 
-  auto getEntities() const
+  auto get_entities() const
       -> const std::unordered_map<EntityID, std::unique_ptr<Entity>> & {
     return m_entities;
   }
 
-  auto getNextEntityId() const -> EntityID;
-  void setNextEntityId(EntityID next_id);
+  auto get_next_entity_id() const -> EntityID;
+  void set_next_entity_id(EntityID next_id);
 
-  auto getEntityMutex() -> std::recursive_mutex & { return m_entityMutex; }
+  auto get_entity_mutex() -> std::recursive_mutex & { return m_entity_mutex; }
 
 private:
-  EntityID m_nextEntityId = 1;
+  EntityID m_next_entity_id = 1;
   std::unordered_map<EntityID, std::unique_ptr<Entity>> m_entities;
   std::vector<std::unique_ptr<System>> m_systems;
-  mutable std::recursive_mutex m_entityMutex;
+  mutable std::recursive_mutex m_entity_mutex;
 };
 
 } // namespace Engine::Core

+ 14 - 14
game/map/level_loader.cpp

@@ -64,9 +64,9 @@ auto LevelLoader::loadFromAssets(
     Game::Map::TerrainService::instance().initialize(def);
 
     Game::Map::Environment::apply(def, renderer, camera);
-    res.camFov = def.camera.fovY;
-    res.camNear = def.camera.near_plane;
-    res.camFar = def.camera.far_plane;
+    res.cam_fov = def.camera.fovY;
+    res.cam_near = def.camera.near_plane;
+    res.cam_far = def.camera.far_plane;
     res.grid_width = def.grid.width;
     res.grid_height = def.grid.height;
     res.tile_size = def.grid.tile_size;
@@ -77,7 +77,7 @@ auto LevelLoader::loadFromAssets(
         visuals_loaded ? &visual_catalog : nullptr;
     auto rt = Game::Map::MapTransformer::applyToWorld(def, world, catalog_ptr);
     if (!rt.unit_ids.empty()) {
-      res.playerUnitId = rt.unit_ids.front();
+      res.player_unit_id = rt.unit_ids.front();
     } else {
 
       auto &nationRegistry = Game::Systems::NationRegistry::instance();
@@ -87,7 +87,7 @@ auto LevelLoader::loadFromAssets(
         sp.position = QVector3D(0.0F, 0.0F, 0.0F);
         sp.player_id = 0;
         sp.spawn_type = Game::Units::SpawnType::Archer;
-        sp.aiControlled = !owners.isPlayer(sp.player_id);
+        sp.ai_controlled = !owners.isPlayer(sp.player_id);
         if (const auto *nation =
                 nationRegistry.getNationForPlayer(sp.player_id)) {
           sp.nation_id = nation->id;
@@ -96,7 +96,7 @@ auto LevelLoader::loadFromAssets(
         }
         if (auto unit =
                 reg->create(Game::Units::SpawnType::Archer, world, sp)) {
-          res.playerUnitId = unit->id();
+          res.player_unit_id = unit->id();
         } else {
           qWarning() << "LevelLoader: Fallback archer spawn failed";
         }
@@ -104,8 +104,8 @@ auto LevelLoader::loadFromAssets(
     }
 
     bool has_barracks = false;
-    for (auto *e : world.getEntitiesWith<Engine::Core::UnitComponent>()) {
-      if (auto *u = e->getComponent<Engine::Core::UnitComponent>()) {
+    for (auto *e : world.get_entities_with<Engine::Core::UnitComponent>()) {
+      if (auto *u = e->get_component<Engine::Core::UnitComponent>()) {
         if (u->spawn_type == Game::Units::SpawnType::Barracks &&
             owners.isPlayer(u->owner_id)) {
           has_barracks = true;
@@ -121,7 +121,7 @@ auto LevelLoader::loadFromAssets(
         sp.position = QVector3D(-4.0F, 0.0F, -3.0F);
         sp.player_id = owners.getLocalPlayerId();
         sp.spawn_type = Game::Units::SpawnType::Barracks;
-        sp.aiControlled = !owners.isPlayer(sp.player_id);
+        sp.ai_controlled = !owners.isPlayer(sp.player_id);
         if (const auto *nation =
                 nationRegistry.getNationForPlayer(sp.player_id)) {
           sp.nation_id = nation->id;
@@ -139,9 +139,9 @@ auto LevelLoader::loadFromAssets(
                << "- applying default environment";
     Game::Map::Environment::applyDefault(renderer, camera);
     res.ok = false;
-    res.camFov = camera.getFOV();
-    res.camNear = camera.getNear();
-    res.camFar = camera.getFar();
+    res.cam_fov = camera.getFOV();
+    res.cam_near = camera.getNear();
+    res.cam_far = camera.getFar();
     res.grid_width = 50;
     res.grid_height = 50;
     res.tile_size = 1.0F;
@@ -153,7 +153,7 @@ auto LevelLoader::loadFromAssets(
       sp.position = QVector3D(0.0F, 0.0F, 0.0F);
       sp.player_id = 0;
       sp.spawn_type = Game::Units::SpawnType::Archer;
-      sp.aiControlled = !owners.isPlayer(sp.player_id);
+      sp.ai_controlled = !owners.isPlayer(sp.player_id);
       if (const auto *nation =
               nationRegistry.getNationForPlayer(sp.player_id)) {
         sp.nation_id = nation->id;
@@ -161,7 +161,7 @@ auto LevelLoader::loadFromAssets(
         sp.nation_id = nationRegistry.default_nation_id();
       }
       if (auto unit = reg->create(Game::Units::SpawnType::Archer, world, sp)) {
-        res.playerUnitId = unit->id();
+        res.player_unit_id = unit->id();
       }
     }
   }

+ 4 - 4
game/map/level_loader.h

@@ -20,10 +20,10 @@ struct LevelLoadResult {
   bool ok = false;
   QString map_name;
   QString errorMessage;
-  Engine::Core::EntityID playerUnitId = 0;
-  float camFov = 45.0F;
-  float camNear = 0.1F;
-  float camFar = 1000.0F;
+  Engine::Core::EntityID player_unit_id = 0;
+  float cam_fov = 45.0F;
+  float cam_near = 0.1F;
+  float cam_far = 1000.0F;
   int grid_width = 50;
   int grid_height = 50;
   float tile_size = 1.0F;

+ 1 - 1
game/map/map_definition.h

@@ -34,7 +34,7 @@ struct UnitSpawn {
   float z = 0.0F;
   int player_id = 0;
   int team_id = 0;
-  int maxPopulation = 100;
+  int max_population = 100;
   std::optional<Game::Systems::NationID> nation;
 };
 

+ 1 - 1
game/map/map_loader.cpp

@@ -280,7 +280,7 @@ void readSpawns(const QJsonArray &arr, std::vector<UnitSpawn> &out) {
 
     spawn.team_id = spawn_obj.value(TEAM_ID).toInt(0);
     constexpr int default_max_population = 100;
-    spawn.maxPopulation =
+    spawn.max_population =
         spawn_obj.value(MAX_POPULATION).toInt(default_max_population);
 
     if (spawn_obj.contains(NATION)) {

+ 7 - 7
game/map/map_transformer.cpp

@@ -44,7 +44,7 @@ void MapTransformer::set_local_owner_id(int owner_id) {
   owners.setLocalPlayerId(owner_id);
 }
 
-auto MapTransformer::localOwnerId() -> int {
+auto MapTransformer::local_owner_id() -> int {
   auto &owners = Game::Systems::OwnerRegistry::instance();
   return owners.getLocalPlayerId();
 }
@@ -175,8 +175,8 @@ auto MapTransformer::applyToWorld(
       sp.position = QVector3D(world_x, 0.0F, world_z);
       sp.player_id = effective_player_id;
       sp.spawn_type = s.type;
-      sp.aiControlled = !owner_registry.isPlayer(effective_player_id);
-      sp.maxPopulation = s.maxPopulation;
+      sp.ai_controlled = !owner_registry.isPlayer(effective_player_id);
+      sp.max_population = s.max_population;
 
       if (s.nation.has_value()) {
         sp.nation_id = s.nation.value();
@@ -190,7 +190,7 @@ auto MapTransformer::applyToWorld(
       }
       auto obj = s_registry->create(s.type, world, sp);
       if (obj) {
-        e = world.getEntity(obj->id());
+        e = world.get_entity(obj->id());
         rt.unit_ids.push_back(obj->id());
       } else {
         qWarning() << "MapTransformer: no factory for spawn type"
@@ -207,7 +207,7 @@ auto MapTransformer::applyToWorld(
       continue;
     }
 
-    if (auto *r = e->getComponent<Engine::Core::RenderableComponent>()) {
+    if (auto *r = e->get_component<Engine::Core::RenderableComponent>()) {
       if (visuals != nullptr) {
         Game::Visuals::VisualDef defv;
         if (visuals->lookup(Game::Units::spawn_typeToString(s.type), defv)) {
@@ -219,9 +219,9 @@ auto MapTransformer::applyToWorld(
       }
     }
 
-    if (auto *t = e->getComponent<Engine::Core::TransformComponent>()) {
+    if (auto *t = e->get_component<Engine::Core::TransformComponent>()) {
       qInfo() << "Spawned" << Game::Units::spawn_typeToQString(s.type)
-              << "id=" << e->getId() << "at"
+              << "id=" << e->get_id() << "at"
               << QVector3D(t->position.x, t->position.y, t->position.z)
               << "(coordSystem="
               << (def.coordSystem == CoordSystem::Grid ? "Grid" : "World")

+ 1 - 1
game/map/map_transformer.h

@@ -31,7 +31,7 @@ public:
   getFactoryRegistry() -> std::shared_ptr<Game::Units::UnitFactoryRegistry>;
 
   static void set_local_owner_id(int owner_id);
-  static auto localOwnerId() -> int;
+  static auto local_owner_id() -> int;
 
   static void
   setPlayerTeamOverrides(const std::unordered_map<int, int> &overrides);

+ 14 - 14
game/map/skirmish_loader.cpp

@@ -65,8 +65,8 @@ SkirmishLoader::SkirmishLoader(Engine::Core::World &world,
 
 void SkirmishLoader::resetGameState() {
   if (auto *selection_system =
-          m_world.getSystem<Game::Systems::SelectionSystem>()) {
-    selection_system->clearSelection();
+          m_world.get_system<Game::Systems::SelectionSystem>()) {
+    selection_system->clear_selection();
   }
 
   m_renderer.pause();
@@ -277,12 +277,12 @@ auto SkirmishLoader::start(const QString &map_path,
       }
     }
 
-    auto entities = m_world.getEntitiesWith<Engine::Core::UnitComponent>();
+    auto entities = m_world.get_entities_with<Engine::Core::UnitComponent>();
     std::unordered_map<int, int> owner_entity_count;
     for (auto *entity : entities) {
-      auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+      auto *unit = entity->get_component<Engine::Core::UnitComponent>();
       auto *renderable =
-          entity->getComponent<Engine::Core::RenderableComponent>();
+          entity->get_component<Engine::Core::RenderableComponent>();
       if ((unit != nullptr) && (renderable != nullptr)) {
         const QVector3D team_color =
             Game::Visuals::team_colorForOwner(unit->owner_id);
@@ -458,12 +458,12 @@ auto SkirmishLoader::start(const QString &map_path,
 
   Engine::Core::Entity *focus_entity = nullptr;
 
-  auto candidates = m_world.getEntitiesWith<Engine::Core::UnitComponent>();
+  auto candidates = m_world.get_entities_with<Engine::Core::UnitComponent>();
   for (auto *entity : candidates) {
     if (entity == nullptr) {
       continue;
     }
-    auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+    auto *unit = entity->get_component<Engine::Core::UnitComponent>();
     if (unit == nullptr) {
       continue;
     }
@@ -474,13 +474,13 @@ auto SkirmishLoader::start(const QString &map_path,
     }
   }
 
-  if ((focus_entity == nullptr) && level_result.playerUnitId != 0) {
-    focus_entity = m_world.getEntity(level_result.playerUnitId);
+  if ((focus_entity == nullptr) && level_result.player_unit_id != 0U) {
+    focus_entity = m_world.get_entity(level_result.player_unit_id);
   }
 
   if (focus_entity != nullptr) {
     if (auto *transform =
-            focus_entity->getComponent<Engine::Core::TransformComponent>()) {
+            focus_entity->get_component<Engine::Core::TransformComponent>()) {
       result.focusPosition = QVector3D(
           transform->position.x, transform->position.y, transform->position.z);
       result.hasFocusPosition = true;
@@ -489,10 +489,10 @@ auto SkirmishLoader::start(const QString &map_path,
 
   result.ok = true;
   result.map_name = level_result.map_name;
-  result.playerUnitId = level_result.playerUnitId;
-  result.camFov = level_result.camFov;
-  result.camNear = level_result.camNear;
-  result.camFar = level_result.camFar;
+  result.player_unit_id = level_result.player_unit_id;
+  result.cam_fov = level_result.cam_fov;
+  result.cam_near = level_result.cam_near;
+  result.cam_far = level_result.cam_far;
   result.grid_width = level_result.grid_width;
   result.grid_height = level_result.grid_height;
   result.tile_size = level_result.tile_size;

+ 4 - 4
game/map/skirmish_loader.h

@@ -37,10 +37,10 @@ struct SkirmishLoadResult {
   bool ok = false;
   QString map_name;
   QString errorMessage;
-  Engine::Core::EntityID playerUnitId = 0;
-  float camFov = 45.0F;
-  float camNear = 0.1F;
-  float camFar = 1000.0F;
+  Engine::Core::EntityID player_unit_id = 0;
+  float cam_fov = 45.0F;
+  float cam_near = 0.1F;
+  float cam_far = 1000.0F;
   int grid_width = 50;
   int grid_height = 50;
   float tile_size = 1.0F;

+ 3 - 3
game/map/visibility_service.cpp

@@ -110,14 +110,14 @@ auto VisibilityService::gatherVisionSources(Engine::Core::World &world,
     -> std::vector<VisibilityService::VisionSource> {
   std::vector<VisionSource> sources;
   const auto entities =
-      world.getEntitiesWith<Engine::Core::TransformComponent>();
+      world.get_entities_with<Engine::Core::TransformComponent>();
   const float range_padding = m_tile_size * k_half_cell_offset;
 
   auto &owner_registry = Game::Systems::OwnerRegistry::instance();
 
   for (auto *entity : entities) {
-    auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
-    auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+    auto *transform = entity->get_component<Engine::Core::TransformComponent>();
+    auto *unit = entity->get_component<Engine::Core::UnitComponent>();
     if (transform == nullptr || unit == nullptr) {
       continue;
     }

+ 5 - 5
game/map/world_bootstrap.cpp

@@ -31,11 +31,11 @@ auto WorldBootstrap::initialize(Render::GL::Renderer &renderer,
   return true;
 }
 
-void WorldBootstrap::ensureInitialized(bool &initialized,
-                                       Render::GL::Renderer &renderer,
-                                       Render::GL::Camera &camera,
-                                       Render::GL::GroundRenderer *ground,
-                                       QString *out_error) {
+void WorldBootstrap::ensure_initialized(bool &initialized,
+                                        Render::GL::Renderer &renderer,
+                                        Render::GL::Camera &camera,
+                                        Render::GL::GroundRenderer *ground,
+                                        QString *out_error) {
   if (!initialized) {
     initialized = initialize(renderer, camera, ground, out_error);
   }

+ 5 - 5
game/map/world_bootstrap.h

@@ -17,11 +17,11 @@ public:
                          Render::GL::GroundRenderer *ground = nullptr,
                          QString *out_error = nullptr) -> bool;
 
-  static void ensureInitialized(bool &initialized,
-                                Render::GL::Renderer &renderer,
-                                Render::GL::Camera &camera,
-                                Render::GL::GroundRenderer *ground = nullptr,
-                                QString *out_error = nullptr);
+  static void ensure_initialized(bool &initialized,
+                                 Render::GL::Renderer &renderer,
+                                 Render::GL::Camera &camera,
+                                 Render::GL::GroundRenderer *ground = nullptr,
+                                 QString *out_error = nullptr);
 };
 
 } // namespace Game::Map

+ 6 - 6
game/systems/ai_system.cpp

@@ -68,12 +68,12 @@ void AISystem::initializeAIPlayers() {
 
 AISystem::~AISystem() = default;
 
-void AISystem::update(Engine::Core::World *world, float deltaTime) {
+void AISystem::update(Engine::Core::World *world, float delta_time) {
   if (world == nullptr) {
     return;
   }
 
-  m_totalGameTime += deltaTime;
+  m_totalGameTime += delta_time;
 
   m_commandFilter.update(m_totalGameTime);
 
@@ -81,9 +81,9 @@ void AISystem::update(Engine::Core::World *world, float deltaTime) {
 
   for (auto &ai : m_aiInstances) {
 
-    ai.updateTimer += deltaTime;
+    ai.update_timer += delta_time;
 
-    if (ai.updateTimer < 0.3F) {
+    if (ai.update_timer < 0.3F) {
       continue;
     }
 
@@ -98,10 +98,10 @@ void AISystem::update(Engine::Core::World *world, float deltaTime) {
     AI::AIJob job;
     job.snapshot = std::move(snapshot);
     job.context = ai.context;
-    job.deltaTime = ai.updateTimer;
+    job.delta_time = ai.update_timer;
 
     if (ai.worker->trySubmit(std::move(job))) {
-      ai.updateTimer = 0.0F;
+      ai.update_timer = 0.0F;
     }
   }
 }

+ 2 - 2
game/systems/ai_system.h

@@ -25,7 +25,7 @@ public:
   AISystem();
   ~AISystem() override;
 
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 
   void reinitialize();
 
@@ -33,7 +33,7 @@ private:
   struct AIInstance {
     AI::AIContext context;
     std::unique_ptr<AI::AIWorker> worker;
-    float updateTimer = 0.0F;
+    float update_timer = 0.0F;
   };
 
   std::vector<AIInstance> m_aiInstances;

+ 1 - 1
game/systems/ai_system/ai_behavior.h

@@ -11,7 +11,7 @@ public:
   virtual ~AIBehavior() = default;
 
   virtual void execute(const AISnapshot &snapshot, AIContext &context,
-                       float deltaTime,
+                       float delta_time,
                        std::vector<AICommand> &outCommands) = 0;
 
   [[nodiscard]] virtual auto

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

@@ -51,12 +51,12 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
 
       for (std::size_t idx = 0; idx < command.units.size(); ++idx) {
         auto entity_id = command.units[idx];
-        auto *entity = world.getEntity(entity_id);
+        auto *entity = world.get_entity(entity_id);
         if (entity == nullptr) {
           continue;
         }
 
-        auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+        auto *unit = entity->get_component<Engine::Core::UnitComponent>();
         if ((unit == nullptr) || unit->owner_id != aiOwnerId) {
           continue;
         }
@@ -71,9 +71,9 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
       }
 
       CommandService::MoveOptions opts;
-      opts.allowDirectFallback = true;
-      opts.clearAttackIntent = false;
-      opts.groupMove = owned_units.size() > 1;
+      opts.allow_direct_fallback = true;
+      opts.clear_attack_intent = false;
+      opts.group_move = owned_units.size() > 1;
       CommandService::moveUnits(world, owned_units, owned_targets, opts);
       break;
     }
@@ -87,12 +87,12 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
       owned_units.reserve(command.units.size());
 
       for (auto entity_id : command.units) {
-        auto *entity = world.getEntity(entity_id);
+        auto *entity = world.get_entity(entity_id);
         if (entity == nullptr) {
           continue;
         }
 
-        auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+        auto *unit = entity->get_component<Engine::Core::UnitComponent>();
         if ((unit == nullptr) || unit->owner_id != aiOwnerId) {
           continue;
         }
@@ -105,33 +105,33 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
       }
 
       CommandService::attack_target(world, owned_units, command.target_id,
-                                    command.shouldChase);
+                                    command.should_chase);
       break;
     }
 
     case AICommandType::StartProduction: {
-      auto *entity = world.getEntity(command.buildingId);
+      auto *entity = world.get_entity(command.buildingId);
       if (entity == nullptr) {
         break;
       }
 
       auto *production =
-          entity->getComponent<Engine::Core::ProductionComponent>();
+          entity->get_component<Engine::Core::ProductionComponent>();
       if (production == nullptr) {
         break;
       }
 
-      if (production->inProgress) {
+      if (production->in_progress) {
         break;
       }
 
-      auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+      auto *unit = entity->get_component<Engine::Core::UnitComponent>();
       if ((unit != nullptr) && unit->owner_id != aiOwnerId) {
         break;
       }
 
       int const current_troops =
-          Engine::Core::World::countTroopsForPlayer(aiOwnerId);
+          Engine::Core::World::count_troops_for_player(aiOwnerId);
       int const max_troops =
           Game::GameConfig::instance().getMaxTroopsPerPlayer();
       Game::Units::TroopType const product_type = production->product_type;
@@ -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;
     }

+ 2 - 2
game/systems/ai_system/ai_executor.cpp

@@ -7,7 +7,7 @@
 namespace Game::Systems::AI {
 
 void AIExecutor::run(const AISnapshot &snapshot, AIContext &context,
-                     float deltaTime, AIBehaviorRegistry &registry,
+                     float delta_time, AIBehaviorRegistry &registry,
                      std::vector<AICommand> &outCommands) {
 
   bool exclusive_behavior_executed = false;
@@ -20,7 +20,7 @@ void AIExecutor::run(const AISnapshot &snapshot, AIContext &context,
     bool const should_exec = behavior.should_execute(snapshot, context);
 
     if (should_exec) {
-      behavior.execute(snapshot, context, deltaTime, outCommands);
+      behavior.execute(snapshot, context, delta_time, outCommands);
 
       if (!behavior.canRunConcurrently()) {
         exclusive_behavior_executed = true;

+ 1 - 1
game/systems/ai_system/ai_executor.h

@@ -15,7 +15,7 @@ public:
   auto operator=(const AIExecutor &) -> AIExecutor & = delete;
 
   static void run(const AISnapshot &snapshot, AIContext &context,
-                  float deltaTime, AIBehaviorRegistry &registry,
+                  float delta_time, AIBehaviorRegistry &registry,
                   std::vector<AICommand> &outCommands);
 };
 

+ 8 - 8
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.has_component || !entity.movement.has_target) {
       ctx.idleUnits++;
     } else {
       ctx.combatUnits++;
@@ -165,9 +165,9 @@ void AIReasoner::updateContext(const AISnapshot &snapshot, AIContext &ctx) {
   }
 }
 
-void AIReasoner::updateStateMachine(AIContext &ctx, float deltaTime) {
-  ctx.stateTimer += deltaTime;
-  ctx.decisionTimer += deltaTime;
+void AIReasoner::updateStateMachine(AIContext &ctx, float delta_time) {
+  ctx.stateTimer += delta_time;
+  ctx.decisionTimer += delta_time;
 
   constexpr float min_state_duration = 3.0F;
 

+ 1 - 1
game/systems/ai_system/ai_reasoner.h

@@ -14,7 +14,7 @@ public:
 
   static void updateContext(const AISnapshot &snapshot, AIContext &ctx);
 
-  static void updateStateMachine(AIContext &ctx, float deltaTime);
+  static void updateStateMachine(AIContext &ctx, float delta_time);
 };
 
 } // namespace Game::Systems::AI

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

@@ -11,7 +11,7 @@ auto AISnapshotBuilder::build(const Engine::Core::World &world,
   AISnapshot snapshot;
   snapshot.player_id = aiOwnerId;
 
-  auto friendlies = world.getUnitsOwnedBy(aiOwnerId);
+  auto friendlies = world.get_units_owned_by(aiOwnerId);
   snapshot.friendlies.reserve(friendlies.size());
 
   int skipped_no_ai = 0;
@@ -20,12 +20,12 @@ auto AISnapshotBuilder::build(const Engine::Core::World &world,
   int added = 0;
 
   for (auto *entity : friendlies) {
-    if (!entity->hasComponent<Engine::Core::AIControlledComponent>()) {
+    if (!entity->has_component<Engine::Core::AIControlledComponent>()) {
       skipped_no_ai++;
       continue;
     }
 
-    auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+    auto *unit = entity->get_component<Engine::Core::UnitComponent>();
     if (unit == nullptr) {
       skipped_no_unit++;
       continue;
@@ -37,64 +37,64 @@ auto AISnapshotBuilder::build(const Engine::Core::World &world,
     }
 
     EntitySnapshot data;
-    data.id = entity->getId();
+    data.id = entity->get_id();
     data.spawn_type = unit->spawn_type;
     data.owner_id = unit->owner_id;
     data.health = unit->health;
     data.max_health = unit->max_health;
-    data.isBuilding = entity->hasComponent<Engine::Core::BuildingComponent>();
+    data.isBuilding = entity->has_component<Engine::Core::BuildingComponent>();
 
     if (auto *transform =
-            entity->getComponent<Engine::Core::TransformComponent>()) {
+            entity->get_component<Engine::Core::TransformComponent>()) {
       data.posX = transform->position.x;
       data.posY = 0.0F;
       data.posZ = transform->position.z;
     }
 
     if (auto *movement =
-            entity->getComponent<Engine::Core::MovementComponent>()) {
-      data.movement.hasComponent = true;
-      data.movement.hasTarget = movement->hasTarget;
+            entity->get_component<Engine::Core::MovementComponent>()) {
+      data.movement.has_component = true;
+      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;
+            entity->get_component<Engine::Core::ProductionComponent>()) {
+      data.production.has_component = true;
+      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.queueSize =
-          static_cast<int>(production->productionQueue.size());
+      data.production.rally_set = production->rally_set;
+      data.production.rally_x = production->rally_x;
+      data.production.rally_z = production->rally_z;
+      data.production.queue_size =
+          static_cast<int>(production->production_queue.size());
     }
 
     snapshot.friendlies.push_back(std::move(data));
     added++;
   }
 
-  auto enemies = world.getEnemyUnits(aiOwnerId);
+  auto enemies = world.get_enemy_units(aiOwnerId);
   snapshot.visibleEnemies.reserve(enemies.size());
 
   for (auto *entity : enemies) {
-    auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+    auto *unit = entity->get_component<Engine::Core::UnitComponent>();
     if ((unit == nullptr) || unit->health <= 0) {
       continue;
     }
 
-    auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
+    auto *transform = entity->get_component<Engine::Core::TransformComponent>();
     if (transform == nullptr) {
       continue;
     }
 
     ContactSnapshot contact;
-    contact.id = entity->getId();
+    contact.id = entity->get_id();
     contact.isBuilding =
-        entity->hasComponent<Engine::Core::BuildingComponent>();
+        entity->has_component<Engine::Core::BuildingComponent>();
     contact.posX = transform->position.x;
     contact.posY = 0.0F;
     contact.posZ = transform->position.z;

+ 16 - 16
game/systems/ai_system/ai_types.h

@@ -36,22 +36,22 @@ enum class BehaviorPriority {
 };
 
 struct MovementSnapshot {
-  bool hasComponent = false;
-  bool hasTarget = false;
+  bool has_component = false;
+  bool has_target = false;
 };
 
 struct ProductionSnapshot {
-  bool hasComponent = false;
-  bool inProgress = false;
-  float buildTime = 0.0F;
-  float timeRemaining = 0.0F;
-  int producedCount = 0;
-  int maxUnits = 0;
+  bool has_component = false;
+  bool in_progress = false;
+  float build_time = 0.0F;
+  float time_remaining = 0.0F;
+  int produced_count = 0;
+  int max_units = 0;
   Game::Units::TroopType product_type = Game::Units::TroopType::Archer;
-  bool rallySet = false;
-  float rallyX = 0.0F;
-  float rallyZ = 0.0F;
-  int queueSize = 0;
+  bool rally_set = false;
+  float rally_x = 0.0F;
+  float rally_z = 0.0F;
+  int queue_size = 0;
 };
 
 struct EntitySnapshot {
@@ -103,8 +103,8 @@ struct AIContext {
   std::vector<Engine::Core::EntityID> buildings;
   Engine::Core::EntityID primaryBarracks = 0;
 
-  float rallyX = 0.0F;
-  float rallyZ = 0.0F;
+  float rally_x = 0.0F;
+  float rally_z = 0.0F;
   int targetPriority = 0;
 
   int total_units = 0;
@@ -148,7 +148,7 @@ struct AICommand {
   std::vector<float> moveTargetZ;
 
   Engine::Core::EntityID target_id = 0;
-  bool shouldChase = false;
+  bool should_chase = false;
   Engine::Core::EntityID buildingId = 0;
   Game::Units::TroopType product_type = Game::Units::TroopType::Archer;
 };
@@ -161,7 +161,7 @@ struct AIResult {
 struct AIJob {
   AISnapshot snapshot;
   AIContext context;
-  float deltaTime = 0.0F;
+  float delta_time = 0.0F;
 };
 
 } // namespace Game::Systems::AI

+ 2 - 2
game/systems/ai_system/ai_worker.cpp

@@ -82,9 +82,9 @@ void AIWorker::workerLoop() {
       Game::Systems::AI::AIReasoner::updateContext(job.snapshot,
                                                    result.context);
       Game::Systems::AI::AIReasoner::updateStateMachine(result.context,
-                                                        job.deltaTime);
+                                                        job.delta_time);
       Game::Systems::AI::AIExecutor::run(job.snapshot, result.context,
-                                         job.deltaTime, m_registry,
+                                         job.delta_time, m_registry,
                                          result.commands);
 
       {

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

@@ -11,10 +11,10 @@
 namespace Game::Systems::AI {
 
 void AttackBehavior::execute(const AISnapshot &snapshot, AIContext &context,
-                             float deltaTime,
+                             float delta_time,
                              std::vector<AICommand> &outCommands) {
-  m_attackTimer += deltaTime;
-  m_targetLockDuration += deltaTime;
+  m_attackTimer += delta_time;
+  m_targetLockDuration += delta_time;
 
   if (m_attackTimer < 1.5F) {
     return;
@@ -233,7 +233,7 @@ void AttackBehavior::execute(const AISnapshot &snapshot, AIContext &context,
   }
 
   auto claimed_units = claimUnits(unit_ids, getPriority(), "attacking", context,
-                                  m_attackTimer + deltaTime, 2.5F);
+                                  m_attackTimer + delta_time, 2.5F);
 
   if (claimed_units.empty()) {
     return;
@@ -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/attack_behavior.h

@@ -6,7 +6,7 @@ namespace Game::Systems::AI {
 
 class AttackBehavior : public AIBehavior {
 public:
-  void execute(const AISnapshot &snapshot, AIContext &context, float deltaTime,
+  void execute(const AISnapshot &snapshot, AIContext &context, float delta_time,
                std::vector<AICommand> &outCommands) override;
 
   [[nodiscard]] auto

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

@@ -17,9 +17,9 @@
 namespace Game::Systems::AI {
 
 void DefendBehavior::execute(const AISnapshot &snapshot, AIContext &context,
-                             float deltaTime,
+                             float delta_time,
                              std::vector<AICommand> &outCommands) {
-  m_defendTimer += deltaTime;
+  m_defendTimer += delta_time;
 
   float const update_interval = context.barracksUnderThreat ? 0.5F : 1.5F;
 
@@ -142,14 +142,14 @@ void DefendBehavior::execute(const AISnapshot &snapshot, AIContext &context,
 
         auto claimed_units =
             claimUnits(defender_ids, getPriority(), "defending", context,
-                       m_defendTimer + deltaTime, 3.0F);
+                       m_defendTimer + delta_time, 3.0F);
 
         if (!claimed_units.empty()) {
           AICommand attack;
           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;
         }
@@ -186,7 +186,7 @@ void DefendBehavior::execute(const AISnapshot &snapshot, AIContext &context,
 
         auto claimed_units =
             claimUnits(defender_ids, getPriority(), "intercepting", context,
-                       m_defendTimer + deltaTime, 2.0F);
+                       m_defendTimer + delta_time, 2.0F);
 
         if (!claimed_units.empty()) {
 
@@ -272,7 +272,7 @@ void DefendBehavior::execute(const AISnapshot &snapshot, AIContext &context,
 
   auto claimed_for_move =
       claimUnits(units_to_move, BehaviorPriority::Low, "positioning", context,
-                 m_defendTimer + deltaTime, 1.5F);
+                 m_defendTimer + delta_time, 1.5F);
 
   if (claimed_for_move.empty()) {
     return;

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

@@ -6,7 +6,7 @@ namespace Game::Systems::AI {
 
 class DefendBehavior : public AIBehavior {
 public:
-  void execute(const AISnapshot &snapshot, AIContext &context, float deltaTime,
+  void execute(const AISnapshot &snapshot, AIContext &context, float delta_time,
                std::vector<AICommand> &outCommands) override;
 
   [[nodiscard]] auto

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

@@ -14,9 +14,9 @@
 namespace Game::Systems::AI {
 
 void GatherBehavior::execute(const AISnapshot &snapshot, AIContext &context,
-                             float deltaTime,
+                             float delta_time,
                              std::vector<AICommand> &outCommands) {
-  m_gatherTimer += deltaTime;
+  m_gatherTimer += delta_time;
 
   if (m_gatherTimer < 1.0F) {
     return;
@@ -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());
@@ -89,7 +89,7 @@ void GatherBehavior::execute(const AISnapshot &snapshot, AIContext &context,
   }
 
   auto claimed_units = claimUnits(units_to_move, getPriority(), "gathering",
-                                  context, m_gatherTimer + deltaTime, 2.0F);
+                                  context, m_gatherTimer + delta_time, 2.0F);
 
   if (claimed_units.empty()) {
     return;
@@ -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;

+ 1 - 1
game/systems/ai_system/behaviors/gather_behavior.h

@@ -6,7 +6,7 @@ namespace Game::Systems::AI {
 
 class GatherBehavior : public AIBehavior {
 public:
-  void execute(const AISnapshot &snapshot, AIContext &context, float deltaTime,
+  void execute(const AISnapshot &snapshot, AIContext &context, float delta_time,
                std::vector<AICommand> &outCommands) override;
 
   [[nodiscard]] auto

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

@@ -9,9 +9,9 @@
 namespace Game::Systems::AI {
 
 void ProductionBehavior::execute(const AISnapshot &snapshot, AIContext &context,
-                                 float deltaTime,
+                                 float delta_time,
                                  std::vector<AICommand> &outCommands) {
-  m_productionTimer += deltaTime;
+  m_productionTimer += delta_time;
   if (m_productionTimer < 1.5F) {
     return;
   }
@@ -67,18 +67,18 @@ void ProductionBehavior::execute(const AISnapshot &snapshot, AIContext &context,
 
     static int const log_counter = 0;
 
-    if (!entity.production.hasComponent) {
+    if (!entity.production.has_component) {
       continue;
     }
 
     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.queue_size;
     if (total_in_queue >= max_queue_size) {
       continue;
     }

+ 1 - 1
game/systems/ai_system/behaviors/production_behavior.h

@@ -6,7 +6,7 @@ namespace Game::Systems::AI {
 
 class ProductionBehavior : public AIBehavior {
 public:
-  void execute(const AISnapshot &snapshot, AIContext &context, float deltaTime,
+  void execute(const AISnapshot &snapshot, AIContext &context, float delta_time,
                std::vector<AICommand> &outCommands) override;
 
   [[nodiscard]] auto

+ 3 - 3
game/systems/ai_system/behaviors/retreat_behavior.cpp

@@ -13,9 +13,9 @@
 namespace Game::Systems::AI {
 
 void RetreatBehavior::execute(const AISnapshot &snapshot, AIContext &context,
-                              float deltaTime,
+                              float delta_time,
                               std::vector<AICommand> &outCommands) {
-  m_retreatTimer += deltaTime;
+  m_retreatTimer += delta_time;
   if (m_retreatTimer < 1.0F) {
     return;
   }
@@ -81,7 +81,7 @@ void RetreatBehavior::execute(const AISnapshot &snapshot, AIContext &context,
   }
 
   auto claimed_units = claimUnits(unit_ids, getPriority(), "retreating",
-                                  context, m_retreatTimer + deltaTime, 1.0F);
+                                  context, m_retreatTimer + delta_time, 1.0F);
 
   if (claimed_units.empty()) {
     return;

+ 1 - 1
game/systems/ai_system/behaviors/retreat_behavior.h

@@ -6,7 +6,7 @@ namespace Game::Systems::AI {
 
 class RetreatBehavior : public AIBehavior {
 public:
-  void execute(const AISnapshot &snapshot, AIContext &context, float deltaTime,
+  void execute(const AISnapshot &snapshot, AIContext &context, float delta_time,
                std::vector<AICommand> &outCommands) override;
 
   [[nodiscard]] auto

+ 5 - 5
game/systems/arrow_system.cpp

@@ -19,20 +19,20 @@ void ArrowSystem::spawnArrow(const QVector3D &start, const QVector3D &end,
   a.active = true;
   QVector3D const delta = end - start;
   float const dist = delta.length();
-  a.arcHeight = std::clamp(m_config.arcHeightMultiplier * dist,
-                           m_config.arcHeightMin, m_config.arcHeightMax);
+  a.arc_height = std::clamp(m_config.arcHeightMultiplier * dist,
+                            m_config.arcHeightMin, m_config.arcHeightMax);
 
-  a.invDist = (dist > 0.001F) ? (1.0F / dist) : 1.0F;
+  a.inv_dist = (dist > 0.001F) ? (1.0F / dist) : 1.0F;
   m_arrows.push_back(a);
 }
 
-void ArrowSystem::update(Engine::Core::World *, float deltaTime) {
+void ArrowSystem::update(Engine::Core::World *, float delta_time) {
   for (auto &arrow : m_arrows) {
     if (!arrow.active) {
       continue;
     }
 
-    arrow.t += deltaTime * arrow.speed * arrow.invDist;
+    arrow.t += delta_time * arrow.speed * arrow.inv_dist;
     if (arrow.t >= 1.0F) {
       arrow.t = 1.0F;
       arrow.active = false;

+ 3 - 3
game/systems/arrow_system.h

@@ -14,14 +14,14 @@ struct ArrowInstance {
   float t{};
   float speed{};
   bool active{};
-  float arcHeight{};
-  float invDist{};
+  float arc_height{};
+  float inv_dist{};
 };
 
 class ArrowSystem : public Engine::Core::System {
 public:
   ArrowSystem();
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
   void spawnArrow(const QVector3D &start, const QVector3D &end,
                   const QVector3D &color, float speed = 8.0F);
   [[nodiscard]] auto arrows() const -> const std::vector<ArrowInstance> & {

+ 5 - 5
game/systems/building_collision_registry.cpp

@@ -131,7 +131,7 @@ auto BuildingCollisionRegistry::isPointInBuilding(
 
 auto BuildingCollisionRegistry::getOccupiedGridCells(
     const BuildingFootprint &footprint,
-    float gridCellSize) -> std::vector<std::pair<int, int>> {
+    float grid_cell_size) -> std::vector<std::pair<int, int>> {
   std::vector<std::pair<int, int>> cells;
 
   float const half_width = footprint.width / 2.0F;
@@ -139,13 +139,13 @@ auto BuildingCollisionRegistry::getOccupiedGridCells(
 
   float const padding = s_gridPadding;
   int const min_grid_x = static_cast<int>(
-      std::floor((footprint.center_x - half_width - padding) / gridCellSize));
+      std::floor((footprint.center_x - half_width - padding) / grid_cell_size));
   int const max_grid_x = static_cast<int>(
-      std::ceil((footprint.center_x + half_width + padding) / gridCellSize));
+      std::ceil((footprint.center_x + half_width + padding) / grid_cell_size));
   int const min_grid_z = static_cast<int>(
-      std::floor((footprint.center_z - half_depth - padding) / gridCellSize));
+      std::floor((footprint.center_z - half_depth - padding) / grid_cell_size));
   int const max_grid_z = static_cast<int>(
-      std::ceil((footprint.center_z + half_depth + padding) / gridCellSize));
+      std::ceil((footprint.center_z + half_depth + padding) / grid_cell_size));
 
   for (int gx = min_grid_x; gx < max_grid_x; ++gx) {
     for (int gz = min_grid_z; gz < max_grid_z; ++gz) {

+ 1 - 1
game/systems/building_collision_registry.h

@@ -53,7 +53,7 @@ public:
 
   [[nodiscard]] static auto getOccupiedGridCells(
       const BuildingFootprint &footprint,
-      float gridCellSize = 1.0F) -> std::vector<std::pair<int, int>>;
+      float grid_cell_size = 1.0F) -> std::vector<std::pair<int, int>>;
 
   static constexpr float kDefaultGridPadding = 0.1F;
   static void setGridPadding(float padding);

+ 6 - 6
game/systems/camera_follow_system.cpp

@@ -10,15 +10,15 @@ namespace Game::Systems {
 void CameraFollowSystem::update(Engine::Core::World &world,
                                 SelectionSystem &selection,
                                 Render::GL::Camera &camera) {
-  const auto &sel = selection.getSelectedUnits();
+  const auto &sel = selection.get_selected_units();
   if (sel.empty()) {
     return;
   }
   QVector3D sum(0, 0, 0);
   int count = 0;
   for (auto id : sel) {
-    if (auto *e = world.getEntity(id)) {
-      if (auto *t = e->getComponent<Engine::Core::TransformComponent>()) {
+    if (auto *e = world.get_entity(id)) {
+      if (auto *t = e->get_component<Engine::Core::TransformComponent>()) {
         sum += QVector3D(t->position.x, t->position.y, t->position.z);
         ++count;
       }
@@ -34,15 +34,15 @@ void CameraFollowSystem::update(Engine::Core::World &world,
 void CameraFollowSystem::snapToSelection(Engine::Core::World &world,
                                          SelectionSystem &selection,
                                          Render::GL::Camera &camera) {
-  const auto &sel = selection.getSelectedUnits();
+  const auto &sel = selection.get_selected_units();
   if (sel.empty()) {
     return;
   }
   QVector3D sum(0, 0, 0);
   int count = 0;
   for (auto id : sel) {
-    if (auto *e = world.getEntity(id)) {
-      if (auto *t = e->getComponent<Engine::Core::TransformComponent>()) {
+    if (auto *e = world.get_entity(id)) {
+      if (auto *t = e->get_component<Engine::Core::TransformComponent>()) {
         sum += QVector3D(t->position.x, t->position.y, t->position.z);
         ++count;
       }

+ 24 - 24
game/systems/camera_service.cpp

@@ -22,13 +22,13 @@ CameraService::CameraService()
 CameraService::~CameraService() = default;
 
 void CameraService::move(Render::GL::Camera &camera, float dx, float dz) {
-  float const dist = camera.getDistance();
+  float const dist = camera.get_distance();
   float const scale = std::max(0.12F, dist * 0.05F);
   m_controller->move(camera, dx * scale, dz * scale);
 }
 
 void CameraService::elevate(Render::GL::Camera &camera, float dy) {
-  float const distance = camera.getDistance();
+  float const distance = camera.get_distance();
   float const scale = std::clamp(distance * 0.05F, 0.1F, 5.0F);
   m_controller->moveUp(camera, dy * scale);
 }
@@ -37,8 +37,8 @@ void CameraService::zoom(Render::GL::Camera &camera, float delta) {
   m_controller->zoomDistance(camera, delta);
 }
 
-auto CameraService::getDistance(const Render::GL::Camera &camera) -> float {
-  return camera.getDistance();
+auto CameraService::get_distance(const Render::GL::Camera &camera) -> float {
+  return camera.get_distance();
 }
 
 void CameraService::yaw(Render::GL::Camera &camera, float degrees) {
@@ -53,8 +53,8 @@ void CameraService::orbit(Render::GL::Camera &camera, float yaw_deg,
   m_controller->orbit(camera, yaw_deg, pitch_deg);
 }
 
-void CameraService::orbitDirection(Render::GL::Camera &camera, int direction,
-                                   bool shift) {
+void CameraService::orbit_direction(Render::GL::Camera &camera, int direction,
+                                    bool shift) {
   const auto &cam_config = Game::GameConfig::instance().camera();
   float const step =
       shift ? cam_config.orbitStepShift : cam_config.orbitStepNormal;
@@ -62,17 +62,17 @@ void CameraService::orbitDirection(Render::GL::Camera &camera, int direction,
   orbit(camera, 0.0F, pitch);
 }
 
-void CameraService::followSelection(Render::GL::Camera &camera,
-                                    Engine::Core::World &world, bool enable) {
+void CameraService::follow_selection(Render::GL::Camera &camera,
+                                     Engine::Core::World &world, bool enable) {
   m_controller->setFollowEnabled(camera, enable);
 
   if (enable) {
-    if (auto *selection_system = world.getSystem<SelectionSystem>()) {
+    if (auto *selection_system = world.get_system<SelectionSystem>()) {
       m_followSystem->snapToSelection(world, *selection_system, camera);
     }
   } else {
-    auto pos = camera.getPosition();
-    auto tgt = camera.getTarget();
+    auto pos = camera.get_position();
+    auto tgt = camera.get_target();
     camera.lookAt(pos, tgt, QVector3D(0, 1, 0));
   }
 }
@@ -83,25 +83,25 @@ void CameraService::setFollowLerp(Render::GL::Camera &camera, float alpha) {
 }
 
 void CameraService::resetCamera(Render::GL::Camera &camera,
-                                Engine::Core::World &world, int localOwnerId,
-                                unsigned int playerUnitId) {
+                                Engine::Core::World &world, int local_owner_id,
+                                unsigned int player_unit_id) {
   Engine::Core::Entity *focus_entity = nullptr;
-  for (auto *e : world.getEntitiesWith<Engine::Core::UnitComponent>()) {
+  for (auto *e : world.get_entities_with<Engine::Core::UnitComponent>()) {
     if (e == nullptr) {
       continue;
     }
-    auto *u = e->getComponent<Engine::Core::UnitComponent>();
+    auto *u = e->get_component<Engine::Core::UnitComponent>();
     if (u == nullptr) {
       continue;
     }
     if (u->spawn_type == Game::Units::SpawnType::Barracks &&
-        u->owner_id == localOwnerId && u->health > 0) {
+        u->owner_id == local_owner_id && u->health > 0) {
       focus_entity = e;
       break;
     }
   }
-  if ((focus_entity == nullptr) && playerUnitId != 0) {
-    focus_entity = world.getEntity(playerUnitId);
+  if ((focus_entity == nullptr) && player_unit_id != 0U) {
+    focus_entity = world.get_entity(player_unit_id);
   }
 
   if (focus_entity != nullptr) {
@@ -111,7 +111,7 @@ void CameraService::resetCamera(Render::GL::Camera &camera,
 
 void CameraService::snapToEntity(Render::GL::Camera &camera,
                                  Engine::Core::Entity &entity) {
-  if (auto *t = entity.getComponent<Engine::Core::TransformComponent>()) {
+  if (auto *t = entity.get_component<Engine::Core::TransformComponent>()) {
     QVector3D const center(t->position.x, t->position.y, t->position.z);
     const auto &cam_config = Game::GameConfig::instance().camera();
     camera.setRTSView(center, cam_config.defaultDistance,
@@ -119,11 +119,11 @@ void CameraService::snapToEntity(Render::GL::Camera &camera,
   }
 }
 
-void CameraService::updateFollow(Render::GL::Camera &camera,
-                                 Engine::Core::World &world,
-                                 bool followEnabled) {
-  if (followEnabled) {
-    if (auto *selection_system = world.getSystem<SelectionSystem>()) {
+void CameraService::update_follow(Render::GL::Camera &camera,
+                                  Engine::Core::World &world,
+                                  bool follow_enabled) {
+  if (follow_enabled) {
+    if (auto *selection_system = world.get_system<SelectionSystem>()) {
       m_followSystem->update(world, *selection_system, camera);
     }
   }

+ 8 - 8
game/systems/camera_service.h

@@ -27,19 +27,19 @@ public:
   void zoom(Render::GL::Camera &camera, float delta);
   void yaw(Render::GL::Camera &camera, float degrees);
   void orbit(Render::GL::Camera &camera, float yaw_deg, float pitch_deg);
-  void orbitDirection(Render::GL::Camera &camera, int direction, bool shift);
-  void followSelection(Render::GL::Camera &camera, Engine::Core::World &world,
-                       bool enable);
+  void orbit_direction(Render::GL::Camera &camera, int direction, bool shift);
+  void follow_selection(Render::GL::Camera &camera, Engine::Core::World &world,
+                        bool enable);
   void setFollowLerp(Render::GL::Camera &camera, float alpha);
   [[nodiscard]] static auto
-  getDistance(const Render::GL::Camera &camera) -> float;
+  get_distance(const Render::GL::Camera &camera) -> float;
   static void resetCamera(Render::GL::Camera &camera,
-                          Engine::Core::World &world, int localOwnerId,
-                          unsigned int playerUnitId);
+                          Engine::Core::World &world, int local_owner_id,
+                          unsigned int player_unit_id);
   static void snapToEntity(Render::GL::Camera &camera,
                            Engine::Core::Entity &entity);
-  void updateFollow(Render::GL::Camera &camera, Engine::Core::World &world,
-                    bool followEnabled);
+  void update_follow(Render::GL::Camera &camera, Engine::Core::World &world,
+                     bool follow_enabled);
 
 private:
   std::unique_ptr<CameraController> m_controller;

+ 53 - 51
game/systems/capture_system.cpp

@@ -17,19 +17,19 @@
 
 namespace Game::Systems {
 
-void CaptureSystem::update(Engine::Core::World *world, float deltaTime) {
-  processBarrackCapture(world, deltaTime);
+void CaptureSystem::update(Engine::Core::World *world, float delta_time) {
+  processBarrackCapture(world, delta_time);
 }
 
 auto CaptureSystem::countNearbyTroops(Engine::Core::World *world,
                                       float barrack_x, float barrack_z,
                                       int owner_id, float radius) -> int {
   int total_troops = 0;
-  auto entities = world->getEntitiesWith<Engine::Core::UnitComponent>();
+  auto entities = world->get_entities_with<Engine::Core::UnitComponent>();
 
   for (auto *e : entities) {
-    auto *unit = e->getComponent<Engine::Core::UnitComponent>();
-    auto *transform = e->getComponent<Engine::Core::TransformComponent>();
+    auto *unit = e->get_component<Engine::Core::UnitComponent>();
+    auto *transform = e->get_component<Engine::Core::TransformComponent>();
 
     if ((unit == nullptr) || (transform == nullptr) || unit->health <= 0) {
       continue;
@@ -60,22 +60,23 @@ auto CaptureSystem::countNearbyTroops(Engine::Core::World *world,
 
 void CaptureSystem::transferBarrackOwnership(Engine::Core::World *,
                                              Engine::Core::Entity *barrack,
-                                             int newOwnerId) {
-  auto *unit = barrack->getComponent<Engine::Core::UnitComponent>();
-  auto *renderable = barrack->getComponent<Engine::Core::RenderableComponent>();
-  auto *transform = barrack->getComponent<Engine::Core::TransformComponent>();
-  auto *prod = barrack->getComponent<Engine::Core::ProductionComponent>();
+                                             int new_owner_id) {
+  auto *unit = barrack->get_component<Engine::Core::UnitComponent>();
+  auto *renderable =
+      barrack->get_component<Engine::Core::RenderableComponent>();
+  auto *transform = barrack->get_component<Engine::Core::TransformComponent>();
+  auto *prod = barrack->get_component<Engine::Core::ProductionComponent>();
 
   if ((unit == nullptr) || (renderable == nullptr) || (transform == nullptr)) {
     return;
   }
 
   int const previous_owner_id = unit->owner_id;
-  unit->owner_id = newOwnerId;
+  unit->owner_id = new_owner_id;
 
   auto &nation_registry = NationRegistry::instance();
-  if (!Game::Core::isNeutralOwner(newOwnerId)) {
-    if (const auto *nation = nation_registry.getNationForPlayer(newOwnerId)) {
+  if (!Game::Core::isNeutralOwner(new_owner_id)) {
+    if (const auto *nation = nation_registry.getNationForPlayer(new_owner_id)) {
       unit->nation_id = nation->id;
     } else {
       unit->nation_id = nation_registry.default_nation_id();
@@ -84,54 +85,55 @@ void CaptureSystem::transferBarrackOwnership(Engine::Core::World *,
     unit->nation_id = nation_registry.default_nation_id();
   }
 
-  QVector3D const tc = Game::Visuals::team_colorForOwner(newOwnerId);
+  QVector3D const tc = Game::Visuals::team_colorForOwner(new_owner_id);
   renderable->color[0] = tc.x();
   renderable->color[1] = tc.y();
   renderable->color[2] = tc.z();
 
   Game::Systems::BuildingCollisionRegistry::instance().updateBuildingOwner(
-      barrack->getId(), newOwnerId);
+      barrack->get_id(), new_owner_id);
 
-  if (!Game::Core::isNeutralOwner(newOwnerId) && (prod == nullptr)) {
-    prod = barrack->addComponent<Engine::Core::ProductionComponent>();
+  if (!Game::Core::isNeutralOwner(new_owner_id) && (prod == nullptr)) {
+    prod = barrack->add_component<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 (Game::Core::isNeutralOwner(new_owner_id) && (prod != nullptr)) {
+    barrack->remove_component<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(
-      Engine::Core::BarrackCapturedEvent(barrack->getId(), previous_owner_id,
-                                         newOwnerId));
+      Engine::Core::BarrackCapturedEvent(barrack->get_id(), previous_owner_id,
+                                         new_owner_id));
 }
 
 void CaptureSystem::processBarrackCapture(Engine::Core::World *world,
-                                          float deltaTime) {
+                                          float delta_time) {
   constexpr float capture_radius = 8.0F;
   constexpr int troop_advantage_multiplier = 3;
 
-  auto barracks = world->getEntitiesWith<Engine::Core::BuildingComponent>();
+  auto barracks = world->get_entities_with<Engine::Core::BuildingComponent>();
 
   for (auto *barrack : barracks) {
-    auto *unit = barrack->getComponent<Engine::Core::UnitComponent>();
-    auto *transform = barrack->getComponent<Engine::Core::TransformComponent>();
+    auto *unit = barrack->get_component<Engine::Core::UnitComponent>();
+    auto *transform =
+        barrack->get_component<Engine::Core::TransformComponent>();
 
     if ((unit == nullptr) || (transform == nullptr)) {
       continue;
@@ -141,9 +143,9 @@ void CaptureSystem::processBarrackCapture(Engine::Core::World *world,
       continue;
     }
 
-    auto *capture = barrack->getComponent<Engine::Core::CaptureComponent>();
+    auto *capture = barrack->get_component<Engine::Core::CaptureComponent>();
     if (capture == nullptr) {
-      capture = barrack->addComponent<Engine::Core::CaptureComponent>();
+      capture = barrack->add_component<Engine::Core::CaptureComponent>();
     }
 
     float const barrack_x = transform->position.x;
@@ -153,10 +155,10 @@ void CaptureSystem::processBarrackCapture(Engine::Core::World *world,
     int max_enemy_troops = 0;
     int capturing_player_id = -1;
 
-    auto entities = world->getEntitiesWith<Engine::Core::UnitComponent>();
+    auto entities = world->get_entities_with<Engine::Core::UnitComponent>();
     std::vector<int> player_ids;
     for (auto *e : entities) {
-      auto *u = e->getComponent<Engine::Core::UnitComponent>();
+      auto *u = e->get_component<Engine::Core::UnitComponent>();
       if ((u != nullptr) && u->owner_id != barrack_owner_id &&
           !Game::Core::isNeutralOwner(u->owner_id)) {
         if (std::find(player_ids.begin(), player_ids.end(), u->owner_id) ==
@@ -187,24 +189,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 += delta_time;
 
-      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 -= delta_time * 2.0F;
+        if (capture->capture_progress <= 0.0F) {
+          capture->capture_progress = 0.0F;
+          capture->is_being_captured = false;
           capture->capturing_player_id = -1;
         }
       }

+ 3 - 3
game/systems/capture_system.h

@@ -11,17 +11,17 @@ namespace Game::Systems {
 
 class CaptureSystem : public Engine::Core::System {
 public:
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 
 private:
   static void processBarrackCapture(Engine::Core::World *world,
-                                    float deltaTime);
+                                    float delta_time);
   static auto countNearbyTroops(Engine::Core::World *world, float barrack_x,
                                 float barrack_z, int owner_id,
                                 float radius) -> int;
   static void transferBarrackOwnership(Engine::Core::World *world,
                                        Engine::Core::Entity *barrack,
-                                       int newOwnerId);
+                                       int new_owner_id);
 };
 
 } // namespace Game::Systems

+ 3 - 3
game/systems/cleanup_system.cpp

@@ -14,15 +14,15 @@ void CleanupSystem::removeDeadEntities(Engine::Core::World *world) {
   std::vector<Engine::Core::EntityID> entities_to_remove;
 
   auto entities =
-      world->getEntitiesWith<Engine::Core::PendingRemovalComponent>();
+      world->get_entities_with<Engine::Core::PendingRemovalComponent>();
 
   entities_to_remove.reserve(entities.size());
   for (auto *entity : entities) {
-    entities_to_remove.push_back(entity->getId());
+    entities_to_remove.push_back(entity->get_id());
   }
 
   for (auto entity_id : entities_to_remove) {
-    world->destroyEntity(entity_id);
+    world->destroy_entity(entity_id);
   }
 }
 

+ 1 - 1
game/systems/cleanup_system.h

@@ -7,7 +7,7 @@ namespace Game::Systems {
 
 class CleanupSystem : public Engine::Core::System {
 public:
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 
 private:
   static void removeDeadEntities(Engine::Core::World *world);

+ 214 - 201
game/systems/combat_system.cpp

@@ -19,27 +19,29 @@
 
 namespace Game::Systems {
 
-void CombatSystem::update(Engine::Core::World *world, float deltaTime) {
-  processAttacks(world, deltaTime);
-  processAutoEngagement(world, deltaTime);
+void CombatSystem::update(Engine::Core::World *world, float delta_time) {
+  processAttacks(world, delta_time);
+  processAutoEngagement(world, delta_time);
 }
 
-void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
-  auto units = world->getEntitiesWith<Engine::Core::UnitComponent>();
+void CombatSystem::processAttacks(Engine::Core::World *world,
+                                  float delta_time) {
+  auto units = world->get_entities_with<Engine::Core::UnitComponent>();
 
-  auto *arrow_sys = world->getSystem<ArrowSystem>();
+  auto *arrow_sys = world->get_system<ArrowSystem>();
 
   for (auto *attacker : units) {
 
-    if (attacker->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+    if (attacker->has_component<Engine::Core::PendingRemovalComponent>()) {
       continue;
     }
 
-    auto *attacker_unit = attacker->getComponent<Engine::Core::UnitComponent>();
+    auto *attacker_unit =
+        attacker->get_component<Engine::Core::UnitComponent>();
     auto *attacker_transform =
-        attacker->getComponent<Engine::Core::TransformComponent>();
+        attacker->get_component<Engine::Core::TransformComponent>();
     auto *attacker_atk =
-        attacker->getComponent<Engine::Core::AttackComponent>();
+        attacker->get_component<Engine::Core::AttackComponent>();
 
     if ((attacker_unit == nullptr) || (attacker_transform == nullptr)) {
       continue;
@@ -49,25 +51,25 @@ 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->get_entity(attacker_atk->melee_lock_target_id);
       if ((lock_target == nullptr) ||
-          lock_target->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+          lock_target->has_component<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>();
+            lock_target->get_component<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;
           auto *tgt_t =
-              lock_target->getComponent<Engine::Core::TransformComponent>();
+              lock_target->get_component<Engine::Core::TransformComponent>();
           if ((att_t != nullptr) && (tgt_t != nullptr)) {
             float const dx = tgt_t->position.x - att_t->position.x;
             float const dz = tgt_t->position.z - att_t->position.z;
@@ -78,7 +80,7 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
 
             if (dist > max_melee_separation) {
               float const pull_amount =
-                  (dist - ideal_melee_distance) * 0.3F * deltaTime * 5.0F;
+                  (dist - ideal_melee_distance) * 0.3F * delta_time * 5.0F;
 
               if (dist > 0.001F) {
                 QVector3D const direction(dx / dist, 0.0F, dz / dist);
@@ -92,21 +94,22 @@ 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->get_entity(attacker_atk->melee_lock_target_id);
       if ((lock_target != nullptr) &&
-          !lock_target->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+          !lock_target
+               ->has_component<Engine::Core::PendingRemovalComponent>()) {
 
         auto *attack_target =
-            attacker->getComponent<Engine::Core::AttackTargetComponent>();
+            attacker->get_component<Engine::Core::AttackTargetComponent>();
         if (attack_target == nullptr) {
           attack_target =
-              attacker->addComponent<Engine::Core::AttackTargetComponent>();
+              attacker->add_component<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,12 +124,12 @@ 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>();
+          attacker->get_component<Engine::Core::HoldModeComponent>();
       if ((hold_mode != nullptr) && hold_mode->active) {
         if (attacker_unit->spawn_type == Game::Units::SpawnType::Archer) {
 
@@ -139,10 +142,10 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
         }
       }
 
-      attacker_atk->timeSinceLast += deltaTime;
-      t_accum = &attacker_atk->timeSinceLast;
+      attacker_atk->time_since_last += delta_time;
+      t_accum = &attacker_atk->time_since_last;
     } else {
-      tmp_accum += deltaTime;
+      tmp_accum += delta_time;
       t_accum = &tmp_accum;
     }
 
@@ -151,15 +154,16 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
     }
 
     auto *attack_target =
-        attacker->getComponent<Engine::Core::AttackTargetComponent>();
+        attacker->get_component<Engine::Core::AttackTargetComponent>();
     Engine::Core::Entity *best_target = nullptr;
 
     if ((attack_target != nullptr) && attack_target->target_id != 0) {
 
-      auto *target = world->getEntity(attack_target->target_id);
+      auto *target = world->get_entity(attack_target->target_id);
       if ((target != nullptr) &&
-          !target->hasComponent<Engine::Core::PendingRemovalComponent>()) {
-        auto *target_unit = target->getComponent<Engine::Core::UnitComponent>();
+          !target->has_component<Engine::Core::PendingRemovalComponent>()) {
+        auto *target_unit =
+            target->get_component<Engine::Core::UnitComponent>();
 
         auto &owner_registry = Game::Systems::OwnerRegistry::instance();
         bool const is_ally = owner_registry.areAllies(attacker_unit->owner_id,
@@ -168,92 +172,93 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
         if ((target_unit != nullptr) && target_unit->health > 0 &&
             target_unit->owner_id != attacker_unit->owner_id && !is_ally) {
 
-          if (isInRange(attacker, target, range)) {
+          if (is_in_range(attacker, target, range)) {
             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;
             }
 
             if (is_ranged_unit) {
               auto *movement =
-                  attacker->getComponent<Engine::Core::MovementComponent>();
-              if ((movement != nullptr) && movement->hasTarget) {
-                movement->hasTarget = false;
+                  attacker->get_component<Engine::Core::MovementComponent>();
+              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;
                 }
               }
             }
 
             if (auto *att_t =
                     attacker
-                        ->getComponent<Engine::Core::TransformComponent>()) {
+                        ->get_component<Engine::Core::TransformComponent>()) {
               if (auto *tgt_t =
                       target
-                          ->getComponent<Engine::Core::TransformComponent>()) {
+                          ->get_component<Engine::Core::TransformComponent>()) {
                 float const dx = tgt_t->position.x - att_t->position.x;
                 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>();
+                attacker->get_component<Engine::Core::HoldModeComponent>();
             if ((hold_mode != nullptr) && hold_mode->active) {
-              if (!isInRange(attacker, target, range)) {
+              if (!is_in_range(attacker, target, range)) {
                 attacker
-                    ->removeComponent<Engine::Core::AttackTargetComponent>();
+                    ->remove_component<Engine::Core::AttackTargetComponent>();
               }
               continue;
             }
 
             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;
             }
 
-            bool const currently_in_range = isInRange(attacker, target, range);
+            bool const currently_in_range =
+                is_in_range(attacker, target, range);
 
             if (is_ranged_unit && currently_in_range) {
               auto *movement =
-                  attacker->getComponent<Engine::Core::MovementComponent>();
+                  attacker->get_component<Engine::Core::MovementComponent>();
               if (movement != nullptr) {
-                movement->hasTarget = false;
+                movement->has_target = false;
                 movement->vx = 0.0F;
                 movement->vz = 0.0F;
                 movement->path.clear();
                 auto *attacker_transform_component =
-                    attacker->getComponent<Engine::Core::TransformComponent>();
+                    attacker->get_component<Engine::Core::TransformComponent>();
                 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;
             } else {
 
               auto *target_transform =
-                  target->getComponent<Engine::Core::TransformComponent>();
+                  target->get_component<Engine::Core::TransformComponent>();
               auto *attacker_transform_component =
-                  attacker->getComponent<Engine::Core::TransformComponent>();
+                  attacker->get_component<Engine::Core::TransformComponent>();
               if ((target_transform != nullptr) &&
                   (attacker_transform_component != nullptr)) {
                 QVector3D const attacker_pos(
@@ -265,7 +270,7 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
                 bool hold_position = false;
 
                 bool const target_is_building =
-                    target->hasComponent<Engine::Core::BuildingComponent>();
+                    target->has_component<Engine::Core::BuildingComponent>();
                 if (target_is_building) {
                   float const scale_x = target_transform->scale.x;
                   float const scale_z = target_transform->scale.z;
@@ -299,15 +304,16 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
                 }
 
                 auto *movement =
-                    attacker->getComponent<Engine::Core::MovementComponent>();
+                    attacker->get_component<Engine::Core::MovementComponent>();
                 if (movement == nullptr) {
                   movement =
-                      attacker->addComponent<Engine::Core::MovementComponent>();
+                      attacker
+                          ->add_component<Engine::Core::MovementComponent>();
                 }
 
                 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 +322,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,18 +338,18 @@ 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;
                     }
 
                     if (need_new_command) {
                       CommandService::MoveOptions options;
-                      options.clearAttackIntent = false;
+                      options.clear_attack_intent = false;
 
-                      options.allowDirectFallback = true;
+                      options.allow_direct_fallback = true;
                       std::vector<Engine::Core::EntityID> const unit_ids = {
-                          attacker->getId()};
+                          attacker->get_id()};
                       std::vector<QVector3D> const move_targets = {desired_pos};
                       CommandService::moveUnits(*world, unit_ids, move_targets,
                                                 options);
@@ -352,21 +358,21 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
                 }
               }
 
-              if (isInRange(attacker, target, range)) {
+              if (is_in_range(attacker, target, range)) {
                 best_target = target;
               }
             }
           } else {
 
-            attacker->removeComponent<Engine::Core::AttackTargetComponent>();
+            attacker->remove_component<Engine::Core::AttackTargetComponent>();
           }
         } else {
 
-          attacker->removeComponent<Engine::Core::AttackTargetComponent>();
+          attacker->remove_component<Engine::Core::AttackTargetComponent>();
         }
       } else {
 
-        attacker->removeComponent<Engine::Core::AttackTargetComponent>();
+        attacker->remove_component<Engine::Core::AttackTargetComponent>();
       }
     }
 
@@ -379,7 +385,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
           continue;
         }
 
-        auto *target_unit = target->getComponent<Engine::Core::UnitComponent>();
+        auto *target_unit =
+            target->get_component<Engine::Core::UnitComponent>();
         if ((target_unit == nullptr) || target_unit->health <= 0) {
           continue;
         }
@@ -393,11 +400,11 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
           continue;
         }
 
-        if (target->hasComponent<Engine::Core::BuildingComponent>()) {
+        if (target->has_component<Engine::Core::BuildingComponent>()) {
           continue;
         }
 
-        if (isInRange(attacker, target, range)) {
+        if (is_in_range(attacker, target, range)) {
           best_target = target;
           break;
         }
@@ -406,68 +413,69 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
 
     if (best_target != nullptr) {
       auto *best_target_unit =
-          best_target->getComponent<Engine::Core::UnitComponent>();
+          best_target->get_component<Engine::Core::UnitComponent>();
 
-      if (!attacker->hasComponent<Engine::Core::AttackTargetComponent>()) {
+      if (!attacker->has_component<Engine::Core::AttackTargetComponent>()) {
         auto *new_target =
-            attacker->addComponent<Engine::Core::AttackTargetComponent>();
-        new_target->target_id = best_target->getId();
-        new_target->shouldChase = false;
+            attacker->add_component<Engine::Core::AttackTargetComponent>();
+        new_target->target_id = best_target->get_id();
+        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;
+            attacker->get_component<Engine::Core::AttackTargetComponent>();
+        if (existing_target->target_id != best_target->get_id()) {
+          existing_target->target_id = best_target->get_id();
+          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;
       }
 
       if (is_ranged_unit) {
         auto *movement =
-            attacker->getComponent<Engine::Core::MovementComponent>();
-        if ((movement != nullptr) && movement->hasTarget) {
-          movement->hasTarget = false;
+            attacker->get_component<Engine::Core::MovementComponent>();
+        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;
           }
         }
       }
 
       if (auto *att_t =
-              attacker->getComponent<Engine::Core::TransformComponent>()) {
+              attacker->get_component<Engine::Core::TransformComponent>()) {
         if (auto *tgt_t =
-                best_target->getComponent<Engine::Core::TransformComponent>()) {
+                best_target
+                    ->get_component<Engine::Core::TransformComponent>()) {
           float const dx = tgt_t->position.x - att_t->position.x;
           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;
         }
       }
 
       if (arrow_sys != nullptr) {
         auto *att_t =
-            attacker->getComponent<Engine::Core::TransformComponent>();
+            attacker->get_component<Engine::Core::TransformComponent>();
         auto *tgt_t =
-            best_target->getComponent<Engine::Core::TransformComponent>();
-        auto *att_u = attacker->getComponent<Engine::Core::UnitComponent>();
+            best_target->get_component<Engine::Core::TransformComponent>();
+        auto *att_u = attacker->get_component<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,23 +527,23 @@ 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->get_id();
 
         auto *target_atk =
-            best_target->getComponent<Engine::Core::AttackComponent>();
+            best_target->get_component<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->get_id();
         }
 
         auto *att_t =
-            attacker->getComponent<Engine::Core::TransformComponent>();
+            attacker->get_component<Engine::Core::TransformComponent>();
         auto *tgt_t =
-            best_target->getComponent<Engine::Core::TransformComponent>();
+            best_target->get_component<Engine::Core::TransformComponent>();
         if ((att_t != nullptr) && (tgt_t != nullptr)) {
           float const dx = tgt_t->position.x - att_t->position.x;
           float const dz = tgt_t->position.z - att_t->position.z;
@@ -560,25 +568,25 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float deltaTime) {
         }
       }
 
-      dealDamage(world, best_target, damage, attacker->getId());
+      dealDamage(world, best_target, damage, attacker->get_id());
       *t_accum = 0.0F;
     } else {
 
       if ((attack_target == nullptr) &&
-          attacker->hasComponent<Engine::Core::AttackTargetComponent>()) {
-        attacker->removeComponent<Engine::Core::AttackTargetComponent>();
+          attacker->has_component<Engine::Core::AttackTargetComponent>()) {
+        attacker->remove_component<Engine::Core::AttackTargetComponent>();
       }
     }
   }
 }
 
-auto CombatSystem::isInRange(Engine::Core::Entity *attacker,
-                             Engine::Core::Entity *target,
-                             float range) -> bool {
+auto CombatSystem::is_in_range(Engine::Core::Entity *attacker,
+                               Engine::Core::Entity *target,
+                               float range) -> bool {
   auto *attacker_transform =
-      attacker->getComponent<Engine::Core::TransformComponent>();
+      attacker->get_component<Engine::Core::TransformComponent>();
   auto *target_transform =
-      target->getComponent<Engine::Core::TransformComponent>();
+      target->get_component<Engine::Core::TransformComponent>();
 
   if ((attacker_transform == nullptr) || (target_transform == nullptr)) {
     return false;
@@ -593,7 +601,7 @@ auto CombatSystem::isInRange(Engine::Core::Entity *attacker,
   float const distance_squared = dx * dx + dz * dz;
 
   float target_radius = 0.0F;
-  if (target->hasComponent<Engine::Core::BuildingComponent>()) {
+  if (target->has_component<Engine::Core::BuildingComponent>()) {
 
     float const scale_x = target_transform->scale.x;
     float const scale_z = target_transform->scale.z;
@@ -611,12 +619,12 @@ auto CombatSystem::isInRange(Engine::Core::Entity *attacker,
     return false;
   }
 
-  auto *attacker_atk = attacker->getComponent<Engine::Core::AttackComponent>();
+  auto *attacker_atk = attacker->get_component<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;
     }
   }
@@ -627,26 +635,26 @@ auto CombatSystem::isInRange(Engine::Core::Entity *attacker,
 void CombatSystem::dealDamage(Engine::Core::World *world,
                               Engine::Core::Entity *target, int damage,
                               Engine::Core::EntityID attackerId) {
-  auto *unit = target->getComponent<Engine::Core::UnitComponent>();
+  auto *unit = target->get_component<Engine::Core::UnitComponent>();
   if (unit != nullptr) {
     unit->health = std::max(0, unit->health - damage);
 
     int attacker_owner_id = 0;
     if (attackerId != 0 && (world != nullptr)) {
-      auto *attacker = world->getEntity(attackerId);
+      auto *attacker = world->get_entity(attackerId);
       if (attacker != nullptr) {
         auto *attacker_unit =
-            attacker->getComponent<Engine::Core::UnitComponent>();
+            attacker->get_component<Engine::Core::UnitComponent>();
         if (attacker_unit != nullptr) {
           attacker_owner_id = attacker_unit->owner_id;
         }
       }
     }
 
-    if (target->hasComponent<Engine::Core::BuildingComponent>() &&
+    if (target->has_component<Engine::Core::BuildingComponent>() &&
         unit->health > 0) {
       Engine::Core::EventManager::instance().publish(
-          Engine::Core::BuildingAttackedEvent(target->getId(), unit->owner_id,
+          Engine::Core::BuildingAttackedEvent(target->get_id(), unit->owner_id,
                                               unit->spawn_type, attackerId,
                                               attacker_owner_id, damage));
     }
@@ -656,49 +664,51 @@ void CombatSystem::dealDamage(Engine::Core::World *world,
       int const killer_owner_id = attacker_owner_id;
 
       Engine::Core::EventManager::instance().publish(
-          Engine::Core::UnitDiedEvent(target->getId(), unit->owner_id,
+          Engine::Core::UnitDiedEvent(target->get_id(), unit->owner_id,
                                       unit->spawn_type, attackerId,
                                       killer_owner_id));
 
-      auto *target_atk = target->getComponent<Engine::Core::AttackComponent>();
-      if ((target_atk != nullptr) && target_atk->inMeleeLock &&
-          target_atk->meleeLockTargetId != 0) {
+      auto *target_atk = target->get_component<Engine::Core::AttackComponent>();
+      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->get_entity(target_atk->melee_lock_target_id);
           if ((lock_partner != nullptr) &&
               !lock_partner
-                   ->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+                   ->has_component<Engine::Core::PendingRemovalComponent>()) {
             auto *partner_atk =
-                lock_partner->getComponent<Engine::Core::AttackComponent>();
+                lock_partner->get_component<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->get_id()) {
+              partner_atk->in_melee_lock = false;
+              partner_atk->melee_lock_target_id = 0;
             }
           }
         }
       }
 
-      if (target->hasComponent<Engine::Core::BuildingComponent>()) {
+      if (target->has_component<Engine::Core::BuildingComponent>()) {
         BuildingCollisionRegistry::instance().unregisterBuilding(
-            target->getId());
+            target->get_id());
       }
 
-      if (auto *r = target->getComponent<Engine::Core::RenderableComponent>()) {
+      if (auto *r =
+              target->get_component<Engine::Core::RenderableComponent>()) {
         r->visible = false;
       }
 
       if (auto *movement =
-              target->getComponent<Engine::Core::MovementComponent>()) {
-        movement->hasTarget = false;
+              target->get_component<Engine::Core::MovementComponent>()) {
+        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>();
+      target->add_component<Engine::Core::PendingRemovalComponent>();
     }
   }
 }
@@ -710,25 +720,25 @@ 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;
   }
 
   auto *attacker_transform =
-      attacker->getComponent<Engine::Core::TransformComponent>();
+      attacker->get_component<Engine::Core::TransformComponent>();
   if (attacker_transform == nullptr) {
     return;
   }
 
-  auto *attacker_unit = attacker->getComponent<Engine::Core::UnitComponent>();
+  auto *attacker_unit = attacker->get_component<Engine::Core::UnitComponent>();
   if (attacker_unit == nullptr) {
     return;
   }
 
   auto &owner_registry = Game::Systems::OwnerRegistry::instance();
-  auto units = world->getEntitiesWith<Engine::Core::UnitComponent>();
+  auto units = world->get_entities_with<Engine::Core::UnitComponent>();
 
   float closest_enemy_dist_sq = std::numeric_limits<float>::max();
   float closest_height_diff = 0.0F;
@@ -738,7 +748,7 @@ void CombatSystem::updateCombatMode(
       continue;
     }
 
-    auto *target_unit = target->getComponent<Engine::Core::UnitComponent>();
+    auto *target_unit = target->get_component<Engine::Core::UnitComponent>();
     if ((target_unit == nullptr) || target_unit->health <= 0) {
       continue;
     }
@@ -749,7 +759,7 @@ void CombatSystem::updateCombatMode(
     }
 
     auto *target_transform =
-        target->getComponent<Engine::Core::TransformComponent>();
+        target->get_component<Engine::Core::TransformComponent>();
     if (target_transform == nullptr) {
       continue;
     }
@@ -769,11 +779,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,29 +792,31 @@ 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);
-
-  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 =
+      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->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;
   }
 }
 
 void CombatSystem::processAutoEngagement(Engine::Core::World *world,
-                                         float deltaTime) {
-  auto units = world->getEntitiesWith<Engine::Core::UnitComponent>();
+                                         float delta_time) {
+  auto units = world->get_entities_with<Engine::Core::UnitComponent>();
 
   for (auto it = m_engagementCooldowns.begin();
        it != m_engagementCooldowns.end();) {
-    it->second -= deltaTime;
+    it->second -= delta_time;
     if (it->second <= 0.0F) {
       it = m_engagementCooldowns.erase(it);
     } else {
@@ -814,31 +826,31 @@ void CombatSystem::processAutoEngagement(Engine::Core::World *world,
 
   for (auto *unit : units) {
 
-    if (unit->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+    if (unit->has_component<Engine::Core::PendingRemovalComponent>()) {
       continue;
     }
 
-    auto *unit_comp = unit->getComponent<Engine::Core::UnitComponent>();
+    auto *unit_comp = unit->get_component<Engine::Core::UnitComponent>();
     if ((unit_comp == nullptr) || unit_comp->health <= 0) {
       continue;
     }
 
-    if (unit->hasComponent<Engine::Core::BuildingComponent>()) {
+    if (unit->has_component<Engine::Core::BuildingComponent>()) {
       continue;
     }
 
-    auto *attack_comp = unit->getComponent<Engine::Core::AttackComponent>();
-    if ((attack_comp == nullptr) || !attack_comp->canMelee) {
+    auto *attack_comp = unit->get_component<Engine::Core::AttackComponent>();
+    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;
     }
 
-    if (m_engagementCooldowns.find(unit->getId()) !=
+    if (m_engagementCooldowns.find(unit->get_id()) !=
         m_engagementCooldowns.end()) {
       continue;
     }
@@ -853,16 +865,16 @@ void CombatSystem::processAutoEngagement(Engine::Core::World *world,
     if (nearest_enemy != nullptr) {
 
       auto *attack_target =
-          unit->getComponent<Engine::Core::AttackTargetComponent>();
+          unit->get_component<Engine::Core::AttackTargetComponent>();
       if (attack_target == nullptr) {
         attack_target =
-            unit->addComponent<Engine::Core::AttackTargetComponent>();
+            unit->add_component<Engine::Core::AttackTargetComponent>();
       }
       if (attack_target != nullptr) {
-        attack_target->target_id = nearest_enemy->getId();
-        attack_target->shouldChase = true;
+        attack_target->target_id = nearest_enemy->get_id();
+        attack_target->should_chase = true;
 
-        m_engagementCooldowns[unit->getId()] = ENGAGEMENT_COOLDOWN;
+        m_engagementCooldowns[unit->get_id()] = ENGAGEMENT_COOLDOWN;
       }
     }
   }
@@ -870,56 +882,57 @@ void CombatSystem::processAutoEngagement(Engine::Core::World *world,
 
 auto CombatSystem::isUnitIdle(Engine::Core::Entity *unit) -> bool {
 
-  auto *hold_mode = unit->getComponent<Engine::Core::HoldModeComponent>();
+  auto *hold_mode = unit->get_component<Engine::Core::HoldModeComponent>();
   if ((hold_mode != nullptr) && hold_mode->active) {
     return false;
   }
 
   auto *attack_target =
-      unit->getComponent<Engine::Core::AttackTargetComponent>();
+      unit->get_component<Engine::Core::AttackTargetComponent>();
   if ((attack_target != nullptr) && attack_target->target_id != 0) {
     return false;
   }
 
-  auto *movement = unit->getComponent<Engine::Core::MovementComponent>();
-  if ((movement != nullptr) && movement->hasTarget) {
+  auto *movement = unit->get_component<Engine::Core::MovementComponent>();
+  if ((movement != nullptr) && movement->has_target) {
     return false;
   }
 
-  auto *attack_comp = unit->getComponent<Engine::Core::AttackComponent>();
-  if ((attack_comp != nullptr) && attack_comp->inMeleeLock) {
+  auto *attack_comp = unit->get_component<Engine::Core::AttackComponent>();
+  if ((attack_comp != nullptr) && attack_comp->in_melee_lock) {
     return false;
   }
 
-  auto *patrol = unit->getComponent<Engine::Core::PatrolComponent>();
+  auto *patrol = unit->get_component<Engine::Core::PatrolComponent>();
   return (patrol == nullptr) || !patrol->patrolling;
 }
 
 auto CombatSystem::findNearestEnemy(Engine::Core::Entity *unit,
                                     Engine::Core::World *world,
-                                    float maxRange) -> Engine::Core::Entity * {
-  auto *unit_comp = unit->getComponent<Engine::Core::UnitComponent>();
-  auto *unit_transform = unit->getComponent<Engine::Core::TransformComponent>();
+                                    float max_range) -> Engine::Core::Entity * {
+  auto *unit_comp = unit->get_component<Engine::Core::UnitComponent>();
+  auto *unit_transform =
+      unit->get_component<Engine::Core::TransformComponent>();
   if ((unit_comp == nullptr) || (unit_transform == nullptr)) {
     return nullptr;
   }
 
   auto &owner_registry = Game::Systems::OwnerRegistry::instance();
-  auto units = world->getEntitiesWith<Engine::Core::UnitComponent>();
+  auto units = world->get_entities_with<Engine::Core::UnitComponent>();
 
   Engine::Core::Entity *nearest_enemy = nullptr;
-  float nearest_dist_sq = maxRange * maxRange;
+  float nearest_dist_sq = max_range * max_range;
 
   for (auto *target : units) {
     if (target == unit) {
       continue;
     }
 
-    if (target->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+    if (target->has_component<Engine::Core::PendingRemovalComponent>()) {
       continue;
     }
 
-    auto *target_unit = target->getComponent<Engine::Core::UnitComponent>();
+    auto *target_unit = target->get_component<Engine::Core::UnitComponent>();
     if ((target_unit == nullptr) || target_unit->health <= 0) {
       continue;
     }
@@ -931,12 +944,12 @@ auto CombatSystem::findNearestEnemy(Engine::Core::Entity *unit,
       continue;
     }
 
-    if (target->hasComponent<Engine::Core::BuildingComponent>()) {
+    if (target->has_component<Engine::Core::BuildingComponent>()) {
       continue;
     }
 
     auto *target_transform =
-        target->getComponent<Engine::Core::TransformComponent>();
+        target->get_component<Engine::Core::TransformComponent>();
     if (target_transform == nullptr) {
       continue;
     }

+ 6 - 6
game/systems/combat_system.h

@@ -12,23 +12,23 @@ namespace Game::Systems {
 
 class CombatSystem : public Engine::Core::System {
 public:
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 
 private:
-  static void processAttacks(Engine::Core::World *world, float deltaTime);
+  static void processAttacks(Engine::Core::World *world, float delta_time);
   static void updateCombatMode(Engine::Core::Entity *attacker,
                                Engine::Core::World *world,
                                Engine::Core::AttackComponent *attack_comp);
-  static auto isInRange(Engine::Core::Entity *attacker,
-                        Engine::Core::Entity *target, float range) -> bool;
+  static auto is_in_range(Engine::Core::Entity *attacker,
+                          Engine::Core::Entity *target, float range) -> bool;
   static void dealDamage(Engine::Core::World *world,
                          Engine::Core::Entity *target, int damage,
                          Engine::Core::EntityID attackerId = 0);
-  void processAutoEngagement(Engine::Core::World *world, float deltaTime);
+  void processAutoEngagement(Engine::Core::World *world, float delta_time);
   static auto isUnitIdle(Engine::Core::Entity *unit) -> bool;
   static auto findNearestEnemy(Engine::Core::Entity *unit,
                                Engine::Core::World *world,
-                               float maxRange) -> Engine::Core::Entity *;
+                               float max_range) -> Engine::Core::Entity *;
 
   std::unordered_map<Engine::Core::EntityID, float> m_engagementCooldowns;
   static constexpr float ENGAGEMENT_COOLDOWN = 0.5F;

+ 106 - 106
game/systems/command_service.cpp

@@ -116,52 +116,52 @@ void CommandService::moveUnits(Engine::Core::World &world,
     return;
   }
 
-  if (options.groupMove && units.size() > 1) {
+  if (options.group_move && units.size() > 1) {
     moveGroup(world, units, targets, options);
     return;
   }
 
   for (size_t i = 0; i < units.size(); ++i) {
-    auto *e = world.getEntity(units[i]);
+    auto *e = world.get_entity(units[i]);
     if (e == nullptr) {
       continue;
     }
 
-    auto *hold_mode = e->getComponent<Engine::Core::HoldModeComponent>();
+    auto *hold_mode = e->get_component<Engine::Core::HoldModeComponent>();
     if ((hold_mode != nullptr) && hold_mode->active) {
 
       hold_mode->active = false;
-      hold_mode->exitCooldown = hold_mode->standUpDuration;
+      hold_mode->exit_cooldown = hold_mode->stand_up_duration;
     }
 
-    auto *atk = e->getComponent<Engine::Core::AttackComponent>();
-    if ((atk != nullptr) && atk->inMeleeLock) {
+    auto *atk = e->get_component<Engine::Core::AttackComponent>();
+    if ((atk != nullptr) && atk->in_melee_lock) {
 
       continue;
     }
 
-    auto *transform = e->getComponent<Engine::Core::TransformComponent>();
+    auto *transform = e->get_component<Engine::Core::TransformComponent>();
     if (transform == nullptr) {
       continue;
     }
 
-    auto *mv = e->getComponent<Engine::Core::MovementComponent>();
+    auto *mv = e->get_component<Engine::Core::MovementComponent>();
     if (mv == nullptr) {
-      mv = e->addComponent<Engine::Core::MovementComponent>();
+      mv = e->add_component<Engine::Core::MovementComponent>();
     }
     if (mv == nullptr) {
       continue;
     }
 
-    if (options.clearAttackIntent) {
-      e->removeComponent<Engine::Core::AttackTargetComponent>();
+    if (options.clear_attack_intent) {
+      e->remove_component<Engine::Core::AttackTargetComponent>();
     }
 
     const float target_x = targets[i].x();
     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]);
@@ -244,7 +244,7 @@ void CommandService::moveUnits(Engine::Core::World &world,
       int const dx = std::abs(end.x - start.x);
       int const dz = std::abs(end.y - start.y);
       bool use_direct_path = (dx + dz) <= CommandService::DIRECT_PATH_THRESHOLD;
-      if (!options.allowDirectFallback) {
+      if (!options.allow_direct_fallback) {
         use_direct_path = false;
       }
 
@@ -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]);
@@ -349,39 +349,39 @@ void CommandService::moveGroup(Engine::Core::World &world,
   members.reserve(units.size());
 
   for (size_t i = 0; i < units.size(); ++i) {
-    auto *entity = world.getEntity(units[i]);
+    auto *entity = world.get_entity(units[i]);
     if (entity == nullptr) {
       continue;
     }
 
-    auto *hold_mode = entity->getComponent<Engine::Core::HoldModeComponent>();
+    auto *hold_mode = entity->get_component<Engine::Core::HoldModeComponent>();
     if ((hold_mode != nullptr) && hold_mode->active) {
       hold_mode->active = false;
-      hold_mode->exitCooldown = hold_mode->standUpDuration;
+      hold_mode->exit_cooldown = hold_mode->stand_up_duration;
     }
 
-    auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
+    auto *transform = entity->get_component<Engine::Core::TransformComponent>();
     if (transform == nullptr) {
       continue;
     }
 
-    auto *movement = entity->getComponent<Engine::Core::MovementComponent>();
+    auto *movement = entity->get_component<Engine::Core::MovementComponent>();
     if (movement == nullptr) {
-      movement = entity->addComponent<Engine::Core::MovementComponent>();
+      movement = entity->add_component<Engine::Core::MovementComponent>();
     }
     if (movement == nullptr) {
       continue;
     }
 
     bool engaged =
-        entity->getComponent<Engine::Core::AttackTargetComponent>() != nullptr;
+        entity->get_component<Engine::Core::AttackTargetComponent>() != nullptr;
 
-    if (options.clearAttackIntent) {
-      entity->removeComponent<Engine::Core::AttackTargetComponent>();
+    if (options.clear_attack_intent) {
+      entity->remove_component<Engine::Core::AttackTargetComponent>();
       engaged = false;
     }
 
-    auto *unit_component = entity->getComponent<Engine::Core::UnitComponent>();
+    auto *unit_component = entity->get_component<Engine::Core::UnitComponent>();
     float const member_speed = (unit_component != nullptr)
                                    ? std::max(0.1F, unit_component->speed)
                                    : 1.0F;
@@ -401,7 +401,7 @@ void CommandService::moveGroup(Engine::Core::World &world,
     std::vector<Engine::Core::EntityID> const single_unit = {members[0].id};
     std::vector<QVector3D> const single_target = {members[0].target};
     MoveOptions single_options = options;
-    single_options.groupMove = false;
+    single_options.group_move = false;
     moveUnits(world, single_unit, single_target, single_options);
     return;
   }
@@ -492,7 +492,7 @@ void CommandService::moveGroup(Engine::Core::World &world,
       std::clamp(avg_target_distance * 0.5F, 4.0F, 12.0F);
   if (max_target_distance <= near_threshold) {
     MoveOptions direct_options = options;
-    direct_options.groupMove = false;
+    direct_options.group_move = false;
 
     std::vector<Engine::Core::EntityID> direct_ids;
     std::vector<QVector3D> direct_targets;
@@ -544,7 +544,7 @@ void CommandService::moveGroup(Engine::Core::World &world,
 
   if (!direct_members.empty()) {
     MoveOptions direct_options = options;
-    direct_options.groupMove = false;
+    direct_options.group_move = false;
 
     std::vector<Engine::Core::EntityID> direct_ids;
     std::vector<QVector3D> direct_targets;
@@ -562,7 +562,7 @@ void CommandService::moveGroup(Engine::Core::World &world,
   if (regroup_members.size() <= 1) {
     if (!regroup_members.empty()) {
       MoveOptions direct_options = options;
-      direct_options.groupMove = false;
+      direct_options.group_move = false;
       std::vector<Engine::Core::EntityID> const single_ids = {
           regroup_members.front().id};
       std::vector<QVector3D> const single_targets = {
@@ -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;
   }
@@ -643,7 +643,7 @@ void CommandService::moveGroup(Engine::Core::World &world,
   int const dx = std::abs(end.x - start.x);
   int const dz = std::abs(end.y - start.y);
   bool use_direct_path = (dx + dz) <= CommandService::DIRECT_PATH_THRESHOLD;
-  if (!options.allowDirectFallback) {
+  if (!options.allow_direct_fallback) {
     use_direct_path = false;
   }
 
@@ -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;
@@ -731,35 +731,35 @@ void CommandService::processPathResults(Engine::Core::World &world) {
     auto apply_to_member = [&](Engine::Core::EntityID member_id,
                                const QVector3D &target,
                                const QVector3D &offset) {
-      auto *member_entity = world.getEntity(member_id);
+      auto *member_entity = world.get_entity(member_id);
       if (member_entity == nullptr) {
         return;
       }
 
       auto *movement_component =
-          member_entity->getComponent<Engine::Core::MovementComponent>();
+          member_entity->get_component<Engine::Core::MovementComponent>();
       if (movement_component == nullptr) {
         return;
       }
 
       auto *member_transform =
-          member_entity->getComponent<Engine::Core::TransformComponent>();
+          member_entity->get_component<Engine::Core::TransformComponent>();
       if (member_transform == nullptr) {
         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,17 +787,17 @@ 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;
         }
       }
 
-      if (request_info.options.allowDirectFallback) {
+      if (request_info.options.allow_direct_fallback) {
         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;
       }
     };
 
@@ -849,47 +849,47 @@ void CommandService::processPathResults(Engine::Core::World &world) {
 void CommandService::attack_target(
     Engine::Core::World &world,
     const std::vector<Engine::Core::EntityID> &units,
-    Engine::Core::EntityID target_id, bool shouldChase) {
+    Engine::Core::EntityID target_id, bool should_chase) {
   if (target_id == 0) {
     return;
   }
   for (auto unit_id : units) {
-    auto *e = world.getEntity(unit_id);
+    auto *e = world.get_entity(unit_id);
     if (e == nullptr) {
       continue;
     }
 
-    auto *hold_mode = e->getComponent<Engine::Core::HoldModeComponent>();
+    auto *hold_mode = e->get_component<Engine::Core::HoldModeComponent>();
     if ((hold_mode != nullptr) && hold_mode->active) {
 
       hold_mode->active = false;
-      hold_mode->exitCooldown = hold_mode->standUpDuration;
+      hold_mode->exit_cooldown = hold_mode->stand_up_duration;
     }
 
     auto *attack_target =
-        e->getComponent<Engine::Core::AttackTargetComponent>();
+        e->get_component<Engine::Core::AttackTargetComponent>();
     if (attack_target == nullptr) {
-      attack_target = e->addComponent<Engine::Core::AttackTargetComponent>();
+      attack_target = e->add_component<Engine::Core::AttackTargetComponent>();
     }
     if (attack_target == nullptr) {
       continue;
     }
 
     attack_target->target_id = target_id;
-    attack_target->shouldChase = shouldChase;
+    attack_target->should_chase = should_chase;
 
-    if (!shouldChase) {
+    if (!should_chase) {
       continue;
     }
 
-    auto *target_ent = world.getEntity(target_id);
+    auto *target_ent = world.get_entity(target_id);
     if (target_ent == nullptr) {
       continue;
     }
 
     auto *t_trans =
-        target_ent->getComponent<Engine::Core::TransformComponent>();
-    auto *att_trans = e->getComponent<Engine::Core::TransformComponent>();
+        target_ent->get_component<Engine::Core::TransformComponent>();
+    auto *att_trans = e->get_component<Engine::Core::TransformComponent>();
     if ((t_trans == nullptr) || (att_trans == nullptr)) {
       continue;
     }
@@ -902,9 +902,9 @@ void CommandService::attack_target(
 
     float range = 2.0F;
     bool is_ranged_unit = false;
-    if (auto *atk = e->getComponent<Engine::Core::AttackComponent>()) {
+    if (auto *atk = e->get_component<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;
       }
     }
@@ -913,7 +913,7 @@ void CommandService::attack_target(
     float const distance = direction.length();
     if (distance > 0.001F) {
       direction /= distance;
-      if (target_ent->hasComponent<Engine::Core::BuildingComponent>()) {
+      if (target_ent->has_component<Engine::Core::BuildingComponent>()) {
         float const scale_x = t_trans->scale.x;
         float const scale_z = t_trans->scale.z;
         float const target_radius = std::max(scale_x, scale_z) * 0.5F;
@@ -934,23 +934,23 @@ void CommandService::attack_target(
     }
 
     CommandService::MoveOptions opts;
-    opts.clearAttackIntent = false;
-    opts.allowDirectFallback = true;
+    opts.clear_attack_intent = false;
+    opts.allow_direct_fallback = true;
     std::vector<Engine::Core::EntityID> const unit_ids = {unit_id};
     std::vector<QVector3D> const move_targets = {desired_pos};
     CommandService::moveUnits(world, unit_ids, move_targets, opts);
 
-    auto *mv = e->getComponent<Engine::Core::MovementComponent>();
+    auto *mv = e->get_component<Engine::Core::MovementComponent>();
     if (mv == nullptr) {
-      mv = e->addComponent<Engine::Core::MovementComponent>();
+      mv = e->add_component<Engine::Core::MovementComponent>();
     }
     if (mv != nullptr) {
 
       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();
     }
   }

+ 4 - 4
game/systems/command_service.h

@@ -22,9 +22,9 @@ struct Point;
 class CommandService {
 public:
   struct MoveOptions {
-    bool allowDirectFallback = true;
-    bool clearAttackIntent = true;
-    bool groupMove = false;
+    bool allow_direct_fallback = true;
+    bool clear_attack_intent = true;
+    bool group_move = false;
   };
 
   static constexpr int DIRECT_PATH_THRESHOLD = 8;
@@ -49,7 +49,7 @@ public:
   static void attack_target(Engine::Core::World &world,
                             const std::vector<Engine::Core::EntityID> &units,
                             Engine::Core::EntityID target_id,
-                            bool shouldChase = true);
+                            bool should_chase = true);
 
 private:
   struct PendingPathRequest {

+ 24 - 23
game/systems/formation_system.cpp

@@ -11,28 +11,28 @@
 
 namespace Game::Systems {
 
-auto RomanFormation::calculatePositions(int unitCount, const QVector3D &center,
-                                        float baseSpacing) const
+auto RomanFormation::calculatePositions(int unit_count, const QVector3D &center,
+                                        float base_spacing) const
     -> std::vector<QVector3D> {
   std::vector<QVector3D> positions;
-  positions.reserve(unitCount);
+  positions.reserve(unit_count);
 
-  if (unitCount <= 0) {
+  if (unit_count <= 0) {
     return positions;
   }
 
-  float spacing = baseSpacing * 1.2F;
+  float spacing = base_spacing * 1.2F;
 
-  if (unitCount > 100) {
+  if (unit_count > 100) {
     spacing *= 2.0F;
-  } else if (unitCount > 50) {
+  } else if (unit_count > 50) {
     spacing *= 1.5F;
   }
 
-  int const rows = std::max(1, static_cast<int>(std::sqrt(unitCount * 0.7F)));
-  int const cols = (unitCount + rows - 1) / rows;
+  int const rows = std::max(1, static_cast<int>(std::sqrt(unit_count * 0.7F)));
+  int const cols = (unit_count + rows - 1) / rows;
 
-  for (int i = 0; i < unitCount; ++i) {
+  for (int i = 0; i < unit_count; ++i) {
     int const row = i / cols;
     int const col = i % cols;
 
@@ -47,29 +47,29 @@ auto RomanFormation::calculatePositions(int unitCount, const QVector3D &center,
 }
 
 auto BarbarianFormation::calculatePositions(
-    int unitCount, const QVector3D &center,
-    float baseSpacing) const -> std::vector<QVector3D> {
+    int unit_count, const QVector3D &center,
+    float base_spacing) const -> std::vector<QVector3D> {
   std::vector<QVector3D> positions;
-  positions.reserve(unitCount);
+  positions.reserve(unit_count);
 
-  if (unitCount <= 0) {
+  if (unit_count <= 0) {
     return positions;
   }
 
-  float spacing = baseSpacing * 1.8F;
+  float spacing = base_spacing * 1.8F;
 
-  if (unitCount > 100) {
+  if (unit_count > 100) {
     spacing *= 2.0F;
-  } else if (unitCount > 50) {
+  } else if (unit_count > 50) {
     spacing *= 1.5F;
   }
 
   std::mt19937 rng(42);
   std::uniform_real_distribution<float> dist(-0.3F, 0.3F);
 
-  int const side = std::ceil(std::sqrt(static_cast<float>(unitCount)));
+  int const side = std::ceil(std::sqrt(static_cast<float>(unit_count)));
 
-  for (int i = 0; i < unitCount; ++i) {
+  for (int i = 0; i < unit_count; ++i) {
     int const gx = i % side;
     int const gy = i / side;
 
@@ -100,15 +100,16 @@ void FormationSystem::initializeDefaults() {
 }
 
 auto FormationSystem::getFormationPositions(
-    FormationType type, int unitCount, const QVector3D &center,
-    float baseSpacing) -> std::vector<QVector3D> {
+    FormationType type, int unit_count, const QVector3D &center,
+    float base_spacing) -> std::vector<QVector3D> {
   auto it = m_formations.find(type);
   if (it == m_formations.end()) {
     qWarning() << "Formation type not found, using default spread";
-    return RomanFormation().calculatePositions(unitCount, center, baseSpacing);
+    return RomanFormation().calculatePositions(unit_count, center,
+                                               base_spacing);
   }
 
-  return it->second->calculatePositions(unitCount, center, baseSpacing);
+  return it->second->calculatePositions(unit_count, center, base_spacing);
 }
 
 void FormationSystem::registerFormation(FormationType type,

+ 8 - 8
game/systems/formation_system.h

@@ -27,16 +27,16 @@ public:
   virtual ~IFormation() = default;
 
   [[nodiscard]] virtual auto calculatePositions(
-      int unitCount, const QVector3D &center,
-      float baseSpacing = 1.0F) const -> std::vector<QVector3D> = 0;
+      int unit_count, const QVector3D &center,
+      float base_spacing = 1.0F) const -> std::vector<QVector3D> = 0;
 
   [[nodiscard]] virtual auto getType() const -> FormationType = 0;
 };
 
 class RomanFormation : public IFormation {
 public:
-  [[nodiscard]] auto calculatePositions(int unitCount, const QVector3D &center,
-                                        float baseSpacing = 1.0F) const
+  [[nodiscard]] auto calculatePositions(int unit_count, const QVector3D &center,
+                                        float base_spacing = 1.0F) const
       -> std::vector<QVector3D> override;
 
   [[nodiscard]] auto getType() const -> FormationType override {
@@ -46,8 +46,8 @@ public:
 
 class BarbarianFormation : public IFormation {
 public:
-  [[nodiscard]] auto calculatePositions(int unitCount, const QVector3D &center,
-                                        float baseSpacing = 1.0F) const
+  [[nodiscard]] auto calculatePositions(int unit_count, const QVector3D &center,
+                                        float base_spacing = 1.0F) const
       -> std::vector<QVector3D> override;
 
   [[nodiscard]] auto getType() const -> FormationType override {
@@ -60,9 +60,9 @@ public:
   static auto instance() -> FormationSystem &;
 
   auto
-  getFormationPositions(FormationType type, int unitCount,
+  getFormationPositions(FormationType type, int unit_count,
                         const QVector3D &center,
-                        float baseSpacing = 1.0F) -> std::vector<QVector3D>;
+                        float base_spacing = 1.0F) -> std::vector<QVector3D>;
 
   void registerFormation(FormationType type,
                          std::unique_ptr<IFormation> formation);

+ 33 - 32
game/systems/game_state_serializer.cpp

@@ -19,8 +19,8 @@ auto GameStateSerializer::buildMetadata(
   metadata["map_path"] = level.map_path;
   metadata["map_name"] = level.map_name;
   metadata["max_troops_per_player"] = level.max_troops_per_player;
-  metadata["localOwnerId"] = runtime.localOwnerId;
-  metadata["playerUnitId"] = static_cast<qint64>(level.playerUnitId);
+  metadata["local_owner_id"] = runtime.local_owner_id;
+  metadata["player_unit_id"] = static_cast<qint64>(level.player_unit_id);
 
   metadata["gameMaxTroopsPerPlayer"] =
       Game::GameConfig::instance().getMaxTroopsPerPlayer();
@@ -35,9 +35,10 @@ auto GameStateSerializer::buildMetadata(
   if (camera != nullptr) {
     QJsonObject camera_obj;
     camera_obj["position"] =
-        App::JsonUtils::vec3ToJsonArray(camera->getPosition());
-    camera_obj["target"] = App::JsonUtils::vec3ToJsonArray(camera->getTarget());
-    camera_obj["distance"] = camera->getDistance();
+        App::JsonUtils::vec3ToJsonArray(camera->get_position());
+    camera_obj["target"] =
+        App::JsonUtils::vec3ToJsonArray(camera->get_target());
+    camera_obj["distance"] = camera->get_distance();
     camera_obj["pitch_deg"] = camera->getPitchDeg();
     camera_obj["fov"] = camera->getFOV();
     camera_obj["near"] = camera->getNear();
@@ -47,11 +48,11 @@ auto GameStateSerializer::buildMetadata(
 
   QJsonObject runtime_obj;
   runtime_obj["paused"] = runtime.paused;
-  runtime_obj["timeScale"] = runtime.timeScale;
-  runtime_obj["victoryState"] = runtime.victoryState;
-  runtime_obj["cursorMode"] = runtime.cursorMode;
-  runtime_obj["selectedPlayerId"] = runtime.selectedPlayerId;
-  runtime_obj["followSelection"] = runtime.followSelection;
+  runtime_obj["time_scale"] = runtime.time_scale;
+  runtime_obj["victoryState"] = runtime.victory_state;
+  runtime_obj["cursorMode"] = runtime.cursor_mode;
+  runtime_obj["selectedPlayerId"] = runtime.selected_player_id;
+  runtime_obj["followSelection"] = runtime.follow_selection;
   metadata["runtime"] = runtime_obj;
 
   return metadata;
@@ -59,17 +60,17 @@ auto GameStateSerializer::buildMetadata(
 
 void GameStateSerializer::restoreCameraFromMetadata(const QJsonObject &metadata,
                                                     Render::GL::Camera *camera,
-                                                    int viewportWidth,
-                                                    int viewportHeight) {
+                                                    int viewport_width,
+                                                    int viewport_height) {
   if (!metadata.contains("camera") || (camera == nullptr)) {
     return;
   }
 
   const auto camera_obj = metadata.value("camera").toObject();
   const QVector3D position = App::JsonUtils::jsonArrayToVec3(
-      camera_obj.value("position"), camera->getPosition());
+      camera_obj.value("position"), camera->get_position());
   const QVector3D target = App::JsonUtils::jsonArrayToVec3(
-      camera_obj.value("target"), camera->getTarget());
+      camera_obj.value("target"), camera->get_target());
   camera->lookAt(position, target, QVector3D(0.0F, 1.0F, 0.0F));
 
   const float near_plane =
@@ -80,8 +81,8 @@ void GameStateSerializer::restoreCameraFromMetadata(const QJsonObject &metadata,
       static_cast<float>(camera_obj.value("fov").toDouble(camera->getFOV()));
 
   float aspect = camera->getAspect();
-  if (viewportHeight > 0) {
-    aspect = float(viewportWidth) / float(std::max(1, viewportHeight));
+  if (viewport_height > 0) {
+    aspect = float(viewport_width) / float(std::max(1, viewport_height));
   }
   camera->setPerspective(fov, aspect, near_plane, far_plane);
 }
@@ -98,31 +99,31 @@ void GameStateSerializer::restoreRuntimeFromMetadata(
     runtime.paused = runtime_obj.value("paused").toBool(runtime.paused);
   }
 
-  if (runtime_obj.contains("timeScale")) {
-    runtime.timeScale = static_cast<float>(
-        runtime_obj.value("timeScale").toDouble(runtime.timeScale));
+  if (runtime_obj.contains("time_scale")) {
+    runtime.time_scale = static_cast<float>(
+        runtime_obj.value("time_scale").toDouble(runtime.time_scale));
   }
 
-  runtime.victoryState =
-      runtime_obj.value("victoryState").toString(runtime.victoryState);
+  runtime.victory_state =
+      runtime_obj.value("victoryState").toString(runtime.victory_state);
 
   if (runtime_obj.contains("cursorMode")) {
     const auto cursor_value = runtime_obj.value("cursorMode");
     if (cursor_value.isDouble()) {
-      runtime.cursorMode = cursor_value.toInt(0);
+      runtime.cursor_mode = cursor_value.toInt(0);
     }
   }
 
-  if (metadata.contains("localOwnerId")) {
-    runtime.localOwnerId =
-        metadata.value("localOwnerId").toInt(runtime.localOwnerId);
+  if (metadata.contains("local_owner_id")) {
+    runtime.local_owner_id =
+        metadata.value("local_owner_id").toInt(runtime.local_owner_id);
   }
 
-  runtime.selectedPlayerId =
-      runtime_obj.value("selectedPlayerId").toInt(runtime.selectedPlayerId);
+  runtime.selected_player_id =
+      runtime_obj.value("selectedPlayerId").toInt(runtime.selected_player_id);
 
-  runtime.followSelection =
-      runtime_obj.value("followSelection").toBool(runtime.followSelection);
+  runtime.follow_selection =
+      runtime_obj.value("followSelection").toBool(runtime.follow_selection);
 }
 
 void GameStateSerializer::restoreLevelFromMetadata(const QJsonObject &metadata,
@@ -136,9 +137,9 @@ void GameStateSerializer::restoreLevelFromMetadata(const QJsonObject &metadata,
     level.map_name = metadata.value("map_name").toString(level.map_name);
   }
 
-  if (metadata.contains("playerUnitId")) {
-    level.playerUnitId = static_cast<Engine::Core::EntityID>(
-        metadata.value("playerUnitId").toVariant().toULongLong());
+  if (metadata.contains("player_unit_id")) {
+    level.player_unit_id = static_cast<Engine::Core::EntityID>(
+        metadata.value("player_unit_id").toVariant().toULongLong());
   }
 
   int max_troops = metadata.value("max_troops_per_player")

+ 12 - 11
game/systems/game_state_serializer.h

@@ -19,21 +19,21 @@ namespace Game::Systems {
 struct LevelSnapshot {
   QString map_path;
   QString map_name;
-  Engine::Core::EntityID playerUnitId = 0;
-  float camFov = 45.0F;
-  float camNear = 0.1F;
-  float camFar = 1000.0F;
+  Engine::Core::EntityID player_unit_id = 0;
+  float cam_fov = 45.0F;
+  float cam_near = 0.1F;
+  float cam_far = 1000.0F;
   int max_troops_per_player = 50;
 };
 
 struct RuntimeSnapshot {
   bool paused = false;
-  float timeScale = 1.0F;
-  int localOwnerId = 1;
-  QString victoryState = "";
-  int cursorMode = 0;
-  int selectedPlayerId = 1;
-  bool followSelection = false;
+  float time_scale = 1.0F;
+  int local_owner_id = 1;
+  QString victory_state = "";
+  int cursor_mode = 0;
+  int selected_player_id = 1;
+  bool follow_selection = false;
 };
 
 class GameStateSerializer {
@@ -45,7 +45,8 @@ public:
 
   static void restoreCameraFromMetadata(const QJsonObject &metadata,
                                         Render::GL::Camera *camera,
-                                        int viewportWidth, int viewportHeight);
+                                        int viewport_width,
+                                        int viewport_height);
 
   static void restoreRuntimeFromMetadata(const QJsonObject &metadata,
                                          RuntimeSnapshot &runtime);

+ 54 - 53
game/systems/global_stats_registry.cpp

@@ -16,84 +16,85 @@ auto GlobalStatsRegistry::instance() -> GlobalStatsRegistry & {
 }
 
 void GlobalStatsRegistry::initialize() {
-  m_unitSpawnedSubscription =
+  m_unit_spawned_subscription =
       Engine::Core::ScopedEventSubscription<Engine::Core::UnitSpawnedEvent>(
           [this](const Engine::Core::UnitSpawnedEvent &e) {
-            onUnitSpawned(e);
+            on_unit_spawned(e);
           });
 
-  m_unitDiedSubscription =
+  m_unit_died_subscription =
       Engine::Core::ScopedEventSubscription<Engine::Core::UnitDiedEvent>(
-          [this](const Engine::Core::UnitDiedEvent &e) { onUnitDied(e); });
+          [this](const Engine::Core::UnitDiedEvent &e) { on_unit_died(e); });
 
-  m_barrackCapturedSubscription =
+  m_barrack_captured_subscription =
       Engine::Core::ScopedEventSubscription<Engine::Core::BarrackCapturedEvent>(
           [this](const Engine::Core::BarrackCapturedEvent &e) {
-            onBarrackCaptured(e);
+            on_barrack_captured(e);
           });
 }
 
-void GlobalStatsRegistry::clear() { m_playerStats.clear(); }
+void GlobalStatsRegistry::clear() { m_player_stats.clear(); }
 
 auto GlobalStatsRegistry::getStats(int owner_id) const -> const PlayerStats * {
-  auto it = m_playerStats.find(owner_id);
-  if (it != m_playerStats.end()) {
+  auto it = m_player_stats.find(owner_id);
+  if (it != m_player_stats.end()) {
     return &it->second;
   }
   return nullptr;
 }
 
 auto GlobalStatsRegistry::getStats(int owner_id) -> PlayerStats * {
-  auto it = m_playerStats.find(owner_id);
-  if (it != m_playerStats.end()) {
+  auto it = m_player_stats.find(owner_id);
+  if (it != m_player_stats.end()) {
     return &it->second;
   }
   return nullptr;
 }
 
-void GlobalStatsRegistry::markGameStart(int owner_id) {
-  auto &stats = m_playerStats[owner_id];
-  stats.gameStartTime = std::chrono::steady_clock::now();
-  stats.gameEnded = false;
-  stats.playTimeSec = 0.0F;
+void GlobalStatsRegistry::mark_game_start(int owner_id) {
+  auto &stats = m_player_stats[owner_id];
+  stats.game_start_time = std::chrono::steady_clock::now();
+  stats.game_ended = false;
+  stats.play_time_sec = 0.0F;
 }
 
-void GlobalStatsRegistry::markGameEnd(int owner_id) {
-  auto it = m_playerStats.find(owner_id);
-  if (it != m_playerStats.end() && !it->second.gameEnded) {
-    it->second.gameEndTime = std::chrono::steady_clock::now();
-    it->second.gameEnded = true;
+void GlobalStatsRegistry::mark_game_end(int owner_id) {
+  auto it = m_player_stats.find(owner_id);
+  if (it != m_player_stats.end() && !it->second.game_ended) {
+    it->second.game_end_time = std::chrono::steady_clock::now();
+    it->second.game_ended = true;
 
     auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
-        it->second.gameEndTime - it->second.gameStartTime);
-    it->second.playTimeSec = duration.count() / 1000.0F;
+        it->second.game_end_time - it->second.game_start_time);
+    it->second.play_time_sec = duration.count() / 1000.0F;
   }
 }
 
-void GlobalStatsRegistry::onUnitSpawned(
+void GlobalStatsRegistry::on_unit_spawned(
     const Engine::Core::UnitSpawnedEvent &event) {
 
-  auto &stats = m_playerStats[event.owner_id];
+  auto &stats = m_player_stats[event.owner_id];
 
   if (event.spawn_type != Game::Units::SpawnType::Barracks) {
     int const individuals_per_unit =
         Game::Units::TroopConfig::instance().getIndividualsPerUnit(
             event.spawn_type);
-    stats.troopsRecruited += individuals_per_unit;
+    stats.troops_recruited += individuals_per_unit;
   } else {
 
-    stats.barracksOwned++;
+    stats.barracks_owned++;
   }
 }
 
-void GlobalStatsRegistry::onUnitDied(const Engine::Core::UnitDiedEvent &event) {
+void GlobalStatsRegistry::on_unit_died(
+    const Engine::Core::UnitDiedEvent &event) {
 
   if (event.spawn_type == Game::Units::SpawnType::Barracks) {
-    auto it = m_playerStats.find(event.owner_id);
-    if (it != m_playerStats.end()) {
-      it->second.barracksOwned--;
-      if (it->second.barracksOwned < 0) {
-        it->second.barracksOwned = 0;
+    auto it = m_player_stats.find(event.owner_id);
+    if (it != m_player_stats.end()) {
+      it->second.barracks_owned--;
+      if (it->second.barracks_owned < 0) {
+        it->second.barracks_owned = 0;
       }
     }
   }
@@ -103,62 +104,62 @@ void GlobalStatsRegistry::onUnitDied(const Engine::Core::UnitDiedEvent &event) {
     auto &owner_registry = OwnerRegistry::instance();
 
     if (owner_registry.areEnemies(event.killer_owner_id, event.owner_id)) {
-      auto &stats = m_playerStats[event.killer_owner_id];
+      auto &stats = m_player_stats[event.killer_owner_id];
 
       if (event.spawn_type != Game::Units::SpawnType::Barracks) {
         int const individuals_per_unit =
             Game::Units::TroopConfig::instance().getIndividualsPerUnit(
                 event.spawn_type);
-        stats.enemiesKilled += individuals_per_unit;
+        stats.enemies_killed += individuals_per_unit;
       }
     }
   }
 }
 
-void GlobalStatsRegistry::onBarrackCaptured(
+void GlobalStatsRegistry::on_barrack_captured(
     const Engine::Core::BarrackCapturedEvent &event) {
 
-  auto prev_it = m_playerStats.find(event.previous_owner_id);
-  if (prev_it != m_playerStats.end() && event.previous_owner_id != -1) {
-    prev_it->second.barracksOwned--;
-    if (prev_it->second.barracksOwned < 0) {
-      prev_it->second.barracksOwned = 0;
+  auto prev_it = m_player_stats.find(event.previous_owner_id);
+  if (prev_it != m_player_stats.end() && event.previous_owner_id != -1) {
+    prev_it->second.barracks_owned--;
+    if (prev_it->second.barracks_owned < 0) {
+      prev_it->second.barracks_owned = 0;
     }
   }
 
-  auto &new_stats = m_playerStats[event.newOwnerId];
-  new_stats.barracksOwned++;
+  auto &new_stats = m_player_stats[event.new_owner_id];
+  new_stats.barracks_owned++;
 }
 
-void GlobalStatsRegistry::rebuildFromWorld(Engine::Core::World &world) {
+void GlobalStatsRegistry::rebuild_from_world(Engine::Core::World &world) {
 
   std::unordered_map<int, std::chrono::steady_clock::time_point> start_times;
-  for (auto &[owner_id, stats] : m_playerStats) {
-    start_times[owner_id] = stats.gameStartTime;
+  for (auto &[owner_id, stats] : m_player_stats) {
+    start_times[owner_id] = stats.game_start_time;
   }
 
-  m_playerStats.clear();
+  m_player_stats.clear();
 
   for (auto &[owner_id, startTime] : start_times) {
-    m_playerStats[owner_id].gameStartTime = startTime;
+    m_player_stats[owner_id].game_start_time = startTime;
   }
 
-  auto entities = world.getEntitiesWith<Engine::Core::UnitComponent>();
+  auto entities = world.get_entities_with<Engine::Core::UnitComponent>();
   for (auto *e : entities) {
-    auto *unit = e->getComponent<Engine::Core::UnitComponent>();
+    auto *unit = e->get_component<Engine::Core::UnitComponent>();
     if ((unit == nullptr) || unit->health <= 0) {
       continue;
     }
 
-    auto &stats = m_playerStats[unit->owner_id];
+    auto &stats = m_player_stats[unit->owner_id];
 
     if (unit->spawn_type == Game::Units::SpawnType::Barracks) {
-      stats.barracksOwned++;
+      stats.barracks_owned++;
     } else {
       int const individuals_per_unit =
           Game::Units::TroopConfig::instance().getIndividualsPerUnit(
               unit->spawn_type);
-      stats.troopsRecruited += individuals_per_unit;
+      stats.troops_recruited += individuals_per_unit;
     }
   }
 }

+ 21 - 17
game/systems/global_stats_registry.h

@@ -11,13 +11,13 @@ class World;
 namespace Game::Systems {
 
 struct PlayerStats {
-  int troopsRecruited = 0;
-  int enemiesKilled = 0;
-  int barracksOwned = 0;
-  std::chrono::steady_clock::time_point gameStartTime;
-  std::chrono::steady_clock::time_point gameEndTime;
-  float playTimeSec = 0.0F;
-  bool gameEnded = false;
+  int troops_recruited = 0;
+  int enemies_killed = 0;
+  int barracks_owned = 0;
+  std::chrono::steady_clock::time_point game_start_time;
+  std::chrono::steady_clock::time_point game_end_time;
+  float play_time_sec = 0.0F;
+  bool game_ended = false;
 };
 
 class GlobalStatsRegistry {
@@ -29,16 +29,20 @@ public:
 
   auto getStats(int owner_id) const -> const PlayerStats *;
   auto getStats(int owner_id) -> PlayerStats *;
+  auto get_stats(int owner_id) const -> const PlayerStats * {
+    return getStats(owner_id);
+  }
+  auto get_stats(int owner_id) -> PlayerStats * { return getStats(owner_id); }
 
-  void markGameStart(int owner_id);
+  void mark_game_start(int owner_id);
 
-  void markGameEnd(int owner_id);
+  void mark_game_end(int owner_id);
 
-  void onUnitSpawned(const Engine::Core::UnitSpawnedEvent &event);
-  void onUnitDied(const Engine::Core::UnitDiedEvent &event);
-  void onBarrackCaptured(const Engine::Core::BarrackCapturedEvent &event);
+  void on_unit_spawned(const Engine::Core::UnitSpawnedEvent &event);
+  void on_unit_died(const Engine::Core::UnitDiedEvent &event);
+  void on_barrack_captured(const Engine::Core::BarrackCapturedEvent &event);
 
-  void rebuildFromWorld(Engine::Core::World &world);
+  void rebuild_from_world(Engine::Core::World &world);
 
 private:
   GlobalStatsRegistry() = default;
@@ -46,14 +50,14 @@ private:
   GlobalStatsRegistry(const GlobalStatsRegistry &) = delete;
   auto operator=(const GlobalStatsRegistry &) -> GlobalStatsRegistry & = delete;
 
-  std::unordered_map<int, PlayerStats> m_playerStats;
+  std::unordered_map<int, PlayerStats> m_player_stats;
 
   Engine::Core::ScopedEventSubscription<Engine::Core::UnitSpawnedEvent>
-      m_unitSpawnedSubscription;
+      m_unit_spawned_subscription;
   Engine::Core::ScopedEventSubscription<Engine::Core::UnitDiedEvent>
-      m_unitDiedSubscription;
+      m_unit_died_subscription;
   Engine::Core::ScopedEventSubscription<Engine::Core::BarrackCapturedEvent>
-      m_barrackCapturedSubscription;
+      m_barrack_captured_subscription;
 };
 
 } // namespace Game::Systems

+ 16 - 16
game/systems/healing_system.cpp

@@ -8,24 +8,24 @@
 
 namespace Game::Systems {
 
-void HealingSystem::update(Engine::Core::World *world, float deltaTime) {
-  processHealing(world, deltaTime);
+void HealingSystem::update(Engine::Core::World *world, float delta_time) {
+  processHealing(world, delta_time);
 }
 
 void HealingSystem::processHealing(Engine::Core::World *world,
-                                   float deltaTime) {
-  auto healers = world->getEntitiesWith<Engine::Core::HealerComponent>();
-  auto *arrow_system = world->getSystem<ArrowSystem>();
+                                   float delta_time) {
+  auto healers = world->get_entities_with<Engine::Core::HealerComponent>();
+  auto *arrow_system = world->get_system<ArrowSystem>();
 
   for (auto *healer : healers) {
-    if (healer->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+    if (healer->has_component<Engine::Core::PendingRemovalComponent>()) {
       continue;
     }
 
-    auto *healer_unit = healer->getComponent<Engine::Core::UnitComponent>();
+    auto *healer_unit = healer->get_component<Engine::Core::UnitComponent>();
     auto *healer_transform =
-        healer->getComponent<Engine::Core::TransformComponent>();
-    auto *healer_comp = healer->getComponent<Engine::Core::HealerComponent>();
+        healer->get_component<Engine::Core::TransformComponent>();
+    auto *healer_comp = healer->get_component<Engine::Core::HealerComponent>();
 
     if ((healer_unit == nullptr) || (healer_transform == nullptr) ||
         (healer_comp == nullptr)) {
@@ -36,22 +36,22 @@ void HealingSystem::processHealing(Engine::Core::World *world,
       continue;
     }
 
-    healer_comp->timeSinceLastHeal += deltaTime;
+    healer_comp->time_since_last_heal += delta_time;
 
-    if (healer_comp->timeSinceLastHeal < healer_comp->healing_cooldown) {
+    if (healer_comp->time_since_last_heal < healer_comp->healing_cooldown) {
       continue;
     }
 
     bool healed_any = false;
-    auto units = world->getEntitiesWith<Engine::Core::UnitComponent>();
+    auto units = world->get_entities_with<Engine::Core::UnitComponent>();
     for (auto *target : units) {
-      if (target->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+      if (target->has_component<Engine::Core::PendingRemovalComponent>()) {
         continue;
       }
 
-      auto *target_unit = target->getComponent<Engine::Core::UnitComponent>();
+      auto *target_unit = target->get_component<Engine::Core::UnitComponent>();
       auto *target_transform =
-          target->getComponent<Engine::Core::TransformComponent>();
+          target->get_component<Engine::Core::TransformComponent>();
 
       if ((target_unit == nullptr) || (target_transform == nullptr)) {
         continue;
@@ -94,7 +94,7 @@ void HealingSystem::processHealing(Engine::Core::World *world,
     }
 
     if (healed_any) {
-      healer_comp->timeSinceLastHeal = 0.0F;
+      healer_comp->time_since_last_heal = 0.0F;
     }
   }
 }

+ 2 - 2
game/systems/healing_system.h

@@ -10,10 +10,10 @@ namespace Game::Systems {
 
 class HealingSystem : public Engine::Core::System {
 public:
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 
 private:
-  void processHealing(Engine::Core::World *world, float deltaTime);
+  void processHealing(Engine::Core::World *world, float delta_time);
 };
 
 } // namespace Game::Systems

+ 75 - 75
game/systems/movement_system.cpp

@@ -86,48 +86,48 @@ auto isSegmentWalkable(const QVector3D &from, const QVector3D &to,
 
 } // namespace
 
-void MovementSystem::update(Engine::Core::World *world, float deltaTime) {
+void MovementSystem::update(Engine::Core::World *world, float delta_time) {
   CommandService::processPathResults(*world);
-  auto entities = world->getEntitiesWith<Engine::Core::MovementComponent>();
+  auto entities = world->get_entities_with<Engine::Core::MovementComponent>();
 
   for (auto *entity : entities) {
-    moveUnit(entity, world, deltaTime);
+    move_unit(entity, world, delta_time);
   }
 }
 
-void MovementSystem::moveUnit(Engine::Core::Entity *entity,
-                              Engine::Core::World *world, float deltaTime) {
-  auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
-  auto *movement = entity->getComponent<Engine::Core::MovementComponent>();
-  auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+void MovementSystem::move_unit(Engine::Core::Entity *entity,
+                               Engine::Core::World *world, float delta_time) {
+  auto *transform = entity->get_component<Engine::Core::TransformComponent>();
+  auto *movement = entity->get_component<Engine::Core::MovementComponent>();
+  auto *unit = entity->get_component<Engine::Core::UnitComponent>();
 
   if ((transform == nullptr) || (movement == nullptr) || (unit == nullptr)) {
     return;
   }
 
   if (unit->health <= 0 ||
-      entity->hasComponent<Engine::Core::PendingRemovalComponent>()) {
+      entity->has_component<Engine::Core::PendingRemovalComponent>()) {
     return;
   }
 
-  auto *hold_mode = entity->getComponent<Engine::Core::HoldModeComponent>();
+  auto *hold_mode = entity->get_component<Engine::Core::HoldModeComponent>();
   bool in_hold_mode = false;
   if (hold_mode != nullptr) {
-    if (hold_mode->exitCooldown > 0.0F) {
-      hold_mode->exitCooldown =
-          std::max(0.0F, hold_mode->exitCooldown - deltaTime);
+    if (hold_mode->exit_cooldown > 0.0F) {
+      hold_mode->exit_cooldown =
+          std::max(0.0F, hold_mode->exit_cooldown - delta_time);
     }
 
     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;
     }
 
-    if (hold_mode->exitCooldown > 0.0F && !in_hold_mode) {
+    if (hold_mode->exit_cooldown > 0.0F && !in_hold_mode) {
       movement->vx = 0.0F;
       movement->vz = 0.0F;
 
@@ -136,85 +136,85 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
   }
 
   if (in_hold_mode) {
-    if (!entity->hasComponent<Engine::Core::BuildingComponent>()) {
-      if (transform->hasDesiredYaw) {
+    if (!entity->has_component<Engine::Core::BuildingComponent>()) {
+      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;
         float const step =
-            std::clamp(diff, -turn_speed * deltaTime, turn_speed * deltaTime);
+            std::clamp(diff, -turn_speed * delta_time, turn_speed * delta_time);
         transform->rotation.y = current + step;
 
         if (std::fabs(diff) < 0.5F) {
-          transform->hasDesiredYaw = false;
+          transform->has_desired_yaw = false;
         }
       }
     }
     return;
   }
 
-  auto *atk = entity->getComponent<Engine::Core::AttackComponent>();
-  if ((atk != nullptr) && atk->inMeleeLock) {
+  auto *atk = entity->get_component<Engine::Core::AttackComponent>();
+  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);
-  bool const destination_allowed = isPointAllowed(final_goal, entity->getId());
+  QVector3D const final_goal(movement->goal_x, 0.0F, movement->goal_y);
+  bool const destination_allowed = isPointAllowed(final_goal, entity->get_id());
 
-  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 - delta_time);
   }
 
-  if (movement->timeSinceLastPathRequest < 10.0F) {
-    movement->timeSinceLastPathRequest += deltaTime;
+  if (movement->time_since_last_path_request < 10.0F) {
+    movement->time_since_last_path_request += delta_time;
   }
 
   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;
-      opts.clearAttackIntent = false;
-      opts.allowDirectFallback = true;
-      std::vector<Engine::Core::EntityID> const ids = {entity->getId()};
+      opts.clear_attack_intent = false;
+      opts.allow_direct_fallback = true;
+      std::vector<Engine::Core::EntityID> const ids = {entity->get_id()};
       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;
     }
 
     if (!requested_recovery_move) {
-      movement->vx *= std::max(0.0F, 1.0F - damping * deltaTime);
-      movement->vz *= std::max(0.0F, 1.0F - damping * deltaTime);
+      movement->vx *= std::max(0.0F, 1.0F - damping * delta_time);
+      movement->vz *= std::max(0.0F, 1.0F - damping * delta_time);
     }
   } else {
     QVector3D current_pos(transform->position.x, 0.0F, transform->position.z);
@@ -241,7 +241,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
       while (!movement->path.empty() && skips_remaining-- > 0) {
         movement->path.erase(movement->path.begin());
         refresh_segment_target();
-        if (isSegmentWalkable(current_pos, segment_target, entity->getId())) {
+        if (isSegmentWalkable(current_pos, segment_target, entity->get_id())) {
           recovered = true;
           break;
         }
@@ -249,7 +249,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
 
       if (!recovered && movement->path.empty()) {
         refresh_segment_target();
-        if (isSegmentWalkable(current_pos, segment_target, entity->getId())) {
+        if (isSegmentWalkable(current_pos, segment_target, entity->get_id())) {
           recovered = true;
         }
       }
@@ -257,33 +257,33 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
       return recovered;
     };
 
-    if (!isSegmentWalkable(current_pos, segment_target, entity->getId())) {
+    if (!isSegmentWalkable(current_pos, segment_target, entity->get_id())) {
       if (try_advance_past_blocked_segment()) {
 
       } 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;
-            opts.clearAttackIntent = false;
-            opts.allowDirectFallback = false;
-            std::vector<Engine::Core::EntityID> const ids = {entity->getId()};
+            opts.clear_attack_intent = false;
+            opts.allow_direct_fallback = false;
+            std::vector<Engine::Core::EntityID> const ids = {entity->get_id()};
             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;
@@ -291,7 +291,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
     }
 
     float const arrive_radius =
-        std::clamp(max_speed * deltaTime * 2.0F, 0.05F, 0.25F);
+        std::clamp(max_speed * delta_time * 2.0F, 0.05F, 0.25F);
     float const arrive_radius_sq = arrive_radius * arrive_radius;
 
     float dx = movement->target_x - transform->position.x;
@@ -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,14 +315,14 @@ 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) {
-      movement->vx *= std::max(0.0F, 1.0F - damping * deltaTime);
-      movement->vz *= std::max(0.0F, 1.0F - damping * deltaTime);
+    if (!movement->has_target) {
+      movement->vx *= std::max(0.0F, 1.0F - damping * delta_time);
+      movement->vz *= std::max(0.0F, 1.0F - damping * delta_time);
     } else {
       float const distance = std::sqrt(std::max(dist2, 0.0F));
       float const nx = dx / std::max(0.0001F, distance);
@@ -337,16 +337,16 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
 
       float const ax = (desired_vx - movement->vx) * accel;
       float const az = (desired_vz - movement->vz) * accel;
-      movement->vx += ax * deltaTime;
-      movement->vz += az * deltaTime;
+      movement->vx += ax * delta_time;
+      movement->vz += az * delta_time;
 
-      movement->vx *= std::max(0.0F, 1.0F - 0.5F * damping * deltaTime);
-      movement->vz *= std::max(0.0F, 1.0F - 0.5F * damping * deltaTime);
+      movement->vx *= std::max(0.0F, 1.0F - 0.5F * damping * delta_time);
+      movement->vz *= std::max(0.0F, 1.0F - 0.5F * damping * delta_time);
     }
   }
 
-  transform->position.x += movement->vx * deltaTime;
-  transform->position.z += movement->vz * deltaTime;
+  transform->position.x += movement->vx * delta_time;
+  transform->position.z += movement->vz * delta_time;
 
   auto &terrain = Game::Map::TerrainService::instance();
   if (terrain.isInitialized()) {
@@ -368,7 +368,7 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
     }
   }
 
-  if (!entity->hasComponent<Engine::Core::BuildingComponent>()) {
+  if (!entity->has_component<Engine::Core::BuildingComponent>()) {
     float const speed2 =
         movement->vx * movement->vx + movement->vz * movement->vz;
     if (speed2 > 1e-5F) {
@@ -381,27 +381,27 @@ void MovementSystem::moveUnit(Engine::Core::Entity *entity,
           std::fmod((target_yaw - current + 540.0F), 360.0F) - 180.0F;
       float const turn_speed = 720.0F;
       float const step =
-          std::clamp(diff, -turn_speed * deltaTime, turn_speed * deltaTime);
+          std::clamp(diff, -turn_speed * delta_time, turn_speed * delta_time);
       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;
       float const step =
-          std::clamp(diff, -turn_speed * deltaTime, turn_speed * deltaTime);
+          std::clamp(diff, -turn_speed * delta_time, turn_speed * delta_time);
       transform->rotation.y = current + step;
 
       if (std::fabs(diff) < 0.5F) {
-        transform->hasDesiredYaw = false;
+        transform->has_desired_yaw = false;
       }
     }
   }
 }
 
-auto MovementSystem::hasReachedTarget(
+auto MovementSystem::has_reached_target(
     const Engine::Core::TransformComponent *transform,
     const Engine::Core::MovementComponent *movement) -> bool {
   float const dx = movement->target_x - transform->position.x;

+ 5 - 5
game/systems/movement_system.h

@@ -12,14 +12,14 @@ namespace Game::Systems {
 
 class MovementSystem : public Engine::Core::System {
 public:
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 
 private:
-  static void moveUnit(Engine::Core::Entity *entity, Engine::Core::World *world,
-                       float deltaTime);
+  static void move_unit(Engine::Core::Entity *entity,
+                        Engine::Core::World *world, float delta_time);
   static auto
-  hasReachedTarget(const Engine::Core::TransformComponent *transform,
-                   const Engine::Core::MovementComponent *movement) -> bool;
+  has_reached_target(const Engine::Core::TransformComponent *transform,
+                     const Engine::Core::MovementComponent *movement) -> bool;
 };
 
 } // namespace Game::Systems

+ 8 - 8
game/systems/nation_loader.cpp

@@ -135,21 +135,21 @@ static auto nation_loader_logger() -> QLoggingCategory & { return logger(); }
 
   TroopType entry{};
   entry.unit_type = troop_type;
-  entry.displayName =
+  entry.display_name =
       read_string(obj, "display_name",
                   QString::fromStdString(base_class.display_name))
           .toStdString();
-  entry.isMelee = read_bool(ensure_object(obj.value("production")), "is_melee",
-                            base_class.production.is_melee);
+  entry.is_melee = read_bool(ensure_object(obj.value("production")), "is_melee",
+                             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 =
       production.value("priority").toInt(base_class.production.priority);
 
-  nation.availableTroops.push_back(entry);
+  nation.available_troops.push_back(entry);
 
   NationTroopVariant variant{};
   variant.unit_type = troop_type;
@@ -244,7 +244,7 @@ static auto nation_loader_logger() -> QLoggingCategory & { return logger(); }
   }
 
   if (has_variant) {
-    nation.troopVariants[troop_type] = std::move(variant);
+    nation.troop_variants[troop_type] = std::move(variant);
   }
 
   return true;
@@ -349,14 +349,14 @@ auto NationLoader::load_from_file(const QString &path)
   }
   nation.id = *parsed_id;
 
-  nation.displayName =
+  nation.display_name =
       root.value("display_name").toString(id_str).toStdString();
 
   const QString building_str =
       root.value("primary_building").toString(QStringLiteral("barracks"));
   auto parsed_building =
       Game::Units::buildingTypeFromString(building_str.toStdString());
-  nation.primaryBuilding =
+  nation.primary_building =
       parsed_building.value_or(Game::Units::BuildingType::Barracks);
   if (auto formation =
           parse_formation_type(root.value("formation_type").toString())) {

+ 17 - 17
game/systems/nation_registry.cpp

@@ -14,20 +14,20 @@
 
 namespace Game::Systems {
 
-auto Nation::getMeleeTroops() const -> std::vector<const TroopType *> {
+auto Nation::get_melee_troops() const -> std::vector<const TroopType *> {
   std::vector<const TroopType *> result;
-  for (const auto &troop : availableTroops) {
-    if (troop.isMelee) {
+  for (const auto &troop : available_troops) {
+    if (troop.is_melee) {
       result.push_back(&troop);
     }
   }
   return result;
 }
 
-auto Nation::getRangedTroops() const -> std::vector<const TroopType *> {
+auto Nation::get_ranged_troops() const -> std::vector<const TroopType *> {
   std::vector<const TroopType *> result;
-  for (const auto &troop : availableTroops) {
-    if (!troop.isMelee) {
+  for (const auto &troop : available_troops) {
+    if (!troop.is_melee) {
       result.push_back(&troop);
     }
   }
@@ -36,7 +36,7 @@ auto Nation::getRangedTroops() const -> std::vector<const TroopType *> {
 
 auto Nation::getTroop(Game::Units::TroopType unit_type) const
     -> const TroopType * {
-  for (const auto &troop : availableTroops) {
+  for (const auto &troop : available_troops) {
     if (troop.unit_type == unit_type) {
       return &troop;
     }
@@ -45,7 +45,7 @@ auto Nation::getTroop(Game::Units::TroopType unit_type) const
 }
 
 auto Nation::getBestMeleeTroop() const -> const TroopType * {
-  auto melee = getMeleeTroops();
+  auto melee = get_melee_troops();
   if (melee.empty()) {
     return nullptr;
   }
@@ -59,7 +59,7 @@ auto Nation::getBestMeleeTroop() const -> const TroopType * {
 }
 
 auto Nation::getBestRangedTroop() const -> const TroopType * {
-  auto ranged = getRangedTroops();
+  auto ranged = get_ranged_troops();
   if (ranged.empty()) {
     return nullptr;
   }
@@ -74,12 +74,12 @@ auto Nation::getBestRangedTroop() const -> const TroopType * {
 
 auto Nation::isMeleeUnit(Game::Units::TroopType unit_type) const -> bool {
   const auto *troop = getTroop(unit_type);
-  return troop != nullptr && troop->isMelee;
+  return troop != nullptr && troop->is_melee;
 }
 
 auto Nation::is_ranged_unit(Game::Units::TroopType unit_type) const -> bool {
   const auto *troop = getTroop(unit_type);
-  return troop != nullptr && !troop->isMelee;
+  return troop != nullptr && !troop->is_melee;
 }
 
 auto NationRegistry::instance() -> NationRegistry & {
@@ -139,8 +139,8 @@ void NationRegistry::initializeDefaults() {
   if (nations.empty()) {
     Nation roman;
     roman.id = NationID::RomanRepublic;
-    roman.displayName = "Roman Republic";
-    roman.primaryBuilding = Game::Units::BuildingType::Barracks;
+    roman.display_name = "Roman Republic";
+    roman.primary_building = Game::Units::BuildingType::Barracks;
     roman.formation_type = FormationType::Roman;
 
     auto appendTroop = [&roman](Game::Units::TroopType type) {
@@ -149,13 +149,13 @@ void NationRegistry::initializeDefaults() {
 
       const auto &troop_class =
           Game::Units::TroopCatalog::instance().get_class_or_fallback(type);
-      troop_entry.displayName = troop_class.display_name;
-      troop_entry.isMelee = troop_class.production.is_melee;
+      troop_entry.display_name = troop_class.display_name;
+      troop_entry.is_melee = 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));
+      roman.available_troops.push_back(std::move(troop_entry));
     };
 
     appendTroop(Game::Units::TroopType::Archer);

+ 10 - 9
game/systems/nation_registry.h

@@ -38,25 +38,26 @@ struct NationTroopVariant {
 
 struct TroopType {
   Game::Units::TroopType unit_type;
-  std::string displayName;
-  bool isMelee = false;
+  std::string display_name;
+  bool is_melee = false;
   int cost = 100;
-  float buildTime = 5.0F;
+  float build_time = 5.0F;
   int priority = 0;
 };
 
 struct Nation {
   NationID id;
-  std::string displayName;
-  std::vector<TroopType> availableTroops;
-  Game::Units::BuildingType primaryBuilding =
+  std::string display_name;
+  std::vector<TroopType> available_troops;
+  Game::Units::BuildingType primary_building =
       Game::Units::BuildingType::Barracks;
   FormationType formation_type = FormationType::Roman;
-  std::unordered_map<Game::Units::TroopType, NationTroopVariant> troopVariants;
+  std::unordered_map<Game::Units::TroopType, NationTroopVariant> troop_variants;
 
-  [[nodiscard]] auto getMeleeTroops() const -> std::vector<const TroopType *>;
+  [[nodiscard]] auto get_melee_troops() const -> std::vector<const TroopType *>;
 
-  [[nodiscard]] auto getRangedTroops() const -> std::vector<const TroopType *>;
+  [[nodiscard]] auto
+  get_ranged_troops() const -> std::vector<const TroopType *>;
 
   [[nodiscard]] auto
   getTroop(Game::Units::TroopType unit_type) const -> const TroopType *;

+ 32 - 31
game/systems/pathfinding.cpp

@@ -175,7 +175,7 @@ auto Pathfinding::findPathInternal(const Point &start,
   setGCost(start_idx, generation, 0);
   setParent(start_idx, generation, start_idx);
 
-  pushOpenNode({start_idx, calculateHeuristic(start, end), 0});
+  push_open_node({start_idx, calculateHeuristic(start, end), 0});
 
   const int max_iterations = std::max(m_width * m_height, 1);
   int iterations = 0;
@@ -185,9 +185,9 @@ auto Pathfinding::findPathInternal(const Point &start,
   while (!m_openHeap.empty() && iterations < max_iterations) {
     ++iterations;
 
-    QueueNode const current = popOpenNode();
+    QueueNode const current = pop_open_node();
 
-    if (current.gCost > getGCost(current.index, generation)) {
+    if (current.g_cost > getGCost(current.index, generation)) {
       continue;
     }
 
@@ -198,14 +198,14 @@ auto Pathfinding::findPathInternal(const Point &start,
     setClosed(current.index, generation);
 
     if (current.index == end_idx) {
-      final_cost = current.gCost;
+      final_cost = current.g_cost;
       break;
     }
 
     const Point current_point = toPoint(current.index);
     std::array<Point, 8> neighbors{};
     const std::size_t neighbor_count =
-        collectNeighbors(current_point, neighbors);
+        collect_neighbors(current_point, neighbors);
 
     for (std::size_t i = 0; i < neighbor_count; ++i) {
       const Point &neighbor = neighbors[i];
@@ -218,7 +218,7 @@ auto Pathfinding::findPathInternal(const Point &start,
         continue;
       }
 
-      const int tentative_gcost = current.gCost + 1;
+      const int tentative_gcost = current.g_cost + 1;
       if (tentative_gcost >= getGCost(neighbor_idx, generation)) {
         continue;
       }
@@ -227,7 +227,7 @@ auto Pathfinding::findPathInternal(const Point &start,
       setParent(neighbor_idx, generation, current.index);
 
       const int h_cost = calculateHeuristic(neighbor, end);
-      pushOpenNode({neighbor_idx, tentative_gcost + h_cost, tentative_gcost});
+      push_open_node({neighbor_idx, tentative_gcost + h_cost, tentative_gcost});
     }
   }
 
@@ -237,7 +237,7 @@ auto Pathfinding::findPathInternal(const Point &start,
 
   std::vector<Point> path;
   path.reserve(final_cost + 1);
-  buildPath(start_idx, end_idx, generation, final_cost + 1, path);
+  build_path(start_idx, end_idx, generation, final_cost + 1, path);
   return path;
 }
 
@@ -339,7 +339,7 @@ void Pathfinding::setParent(int index, std::uint32_t generation,
   }
 }
 
-auto Pathfinding::collectNeighbors(
+auto Pathfinding::collect_neighbors(
     const Point &point, std::array<Point, 8> &buffer) const -> std::size_t {
   std::size_t count = 0;
   for (int dx = -1; dx <= 1; ++dx) {
@@ -368,51 +368,52 @@ auto Pathfinding::collectNeighbors(
   return count;
 }
 
-void Pathfinding::buildPath(int startIndex, int endIndex,
-                            std::uint32_t generation, int expectedLength,
-                            std::vector<Point> &outPath) const {
-  outPath.clear();
-  if (expectedLength > 0) {
-    outPath.reserve(static_cast<std::size_t>(expectedLength));
+void Pathfinding::build_path(int start_index, int end_index,
+                             std::uint32_t generation, int expected_length,
+                             std::vector<Point> &out_path) const {
+  out_path.clear();
+  if (expected_length > 0) {
+    out_path.reserve(static_cast<std::size_t>(expected_length));
   }
-  int current = endIndex;
+  int current = end_index;
 
   while (current >= 0) {
-    outPath.push_back(toPoint(current));
-    if (current == startIndex) {
-      std::reverse(outPath.begin(), outPath.end());
+    out_path.push_back(toPoint(current));
+    if (current == start_index) {
+      std::reverse(out_path.begin(), out_path.end());
       return;
     }
 
     if (!hasParent(current, generation)) {
-      outPath.clear();
+      out_path.clear();
       return;
     }
 
     const int parent = getParent(current, generation);
     if (parent == current || parent < 0) {
-      outPath.clear();
+      out_path.clear();
       return;
     }
     current = parent;
   }
 
-  outPath.clear();
+  out_path.clear();
 }
 
-auto Pathfinding::heapLess(const QueueNode &lhs, const QueueNode &rhs) -> bool {
-  if (lhs.fCost != rhs.fCost) {
-    return lhs.fCost < rhs.fCost;
+auto Pathfinding::heap_less(const QueueNode &lhs,
+                            const QueueNode &rhs) -> bool {
+  if (lhs.f_cost != rhs.f_cost) {
+    return lhs.f_cost < rhs.f_cost;
   }
-  return lhs.gCost < rhs.gCost;
+  return lhs.g_cost < rhs.g_cost;
 }
 
-void Pathfinding::pushOpenNode(const QueueNode &node) {
+void Pathfinding::push_open_node(const QueueNode &node) {
   m_openHeap.push_back(node);
   std::size_t index = m_openHeap.size() - 1;
   while (index > 0) {
     std::size_t const parent = (index - 1) / 2;
-    if (heapLess(m_openHeap[parent], m_openHeap[index])) {
+    if (heap_less(m_openHeap[parent], m_openHeap[index])) {
       break;
     }
     std::swap(m_openHeap[parent], m_openHeap[index]);
@@ -420,7 +421,7 @@ void Pathfinding::pushOpenNode(const QueueNode &node) {
   }
 }
 
-auto Pathfinding::popOpenNode() -> Pathfinding::QueueNode {
+auto Pathfinding::pop_open_node() -> Pathfinding::QueueNode {
   QueueNode top = m_openHeap.front();
   QueueNode const last = m_openHeap.back();
   m_openHeap.pop_back();
@@ -433,10 +434,10 @@ auto Pathfinding::popOpenNode() -> Pathfinding::QueueNode {
       std::size_t const right = left + 1;
       std::size_t smallest = index;
 
-      if (left < size && !heapLess(m_openHeap[smallest], m_openHeap[left])) {
+      if (left < size && !heap_less(m_openHeap[smallest], m_openHeap[left])) {
         smallest = left;
       }
-      if (right < size && !heapLess(m_openHeap[smallest], m_openHeap[right])) {
+      if (right < size && !heap_less(m_openHeap[smallest], m_openHeap[right])) {
         smallest = right;
       }
       if (smallest == index) {

+ 9 - 9
game/systems/pathfinding.h

@@ -83,20 +83,20 @@ private:
   auto getParent(int index, std::uint32_t generation) const -> int;
   void setParent(int index, std::uint32_t generation, int parentIndex);
 
-  auto collectNeighbors(const Point &point,
-                        std::array<Point, 8> &buffer) const -> std::size_t;
-  void buildPath(int startIndex, int endIndex, std::uint32_t generation,
-                 int expectedLength, std::vector<Point> &outPath) const;
+  auto collect_neighbors(const Point &point,
+                         std::array<Point, 8> &buffer) const -> std::size_t;
+  void build_path(int start_index, int end_index, std::uint32_t generation,
+                  int expected_length, std::vector<Point> &out_path) const;
 
   struct QueueNode {
     int index;
-    int fCost;
-    int gCost;
+    int f_cost;
+    int g_cost;
   };
 
-  static auto heapLess(const QueueNode &lhs, const QueueNode &rhs) -> bool;
-  void pushOpenNode(const QueueNode &node);
-  auto popOpenNode() -> QueueNode;
+  static auto heap_less(const QueueNode &lhs, const QueueNode &rhs) -> bool;
+  void push_open_node(const QueueNode &node);
+  auto pop_open_node() -> QueueNode;
 
   void workerLoop();
 

+ 20 - 20
game/systems/patrol_system.cpp

@@ -11,13 +11,13 @@ void PatrolSystem::update(Engine::Core::World *world, float) {
     return;
   }
 
-  auto entities = world->getEntitiesWith<Engine::Core::PatrolComponent>();
+  auto entities = world->get_entities_with<Engine::Core::PatrolComponent>();
 
   for (auto *entity : entities) {
-    auto *patrol = entity->getComponent<Engine::Core::PatrolComponent>();
-    auto *movement = entity->getComponent<Engine::Core::MovementComponent>();
-    auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
-    auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+    auto *patrol = entity->get_component<Engine::Core::PatrolComponent>();
+    auto *movement = entity->get_component<Engine::Core::MovementComponent>();
+    auto *transform = entity->get_component<Engine::Core::TransformComponent>();
+    auto *unit = entity->get_component<Engine::Core::UnitComponent>();
 
     if ((patrol == nullptr) || (movement == nullptr) ||
         (transform == nullptr) || (unit == nullptr)) {
@@ -33,18 +33,18 @@ void PatrolSystem::update(Engine::Core::World *world, float) {
     }
 
     auto *attack_target =
-        entity->getComponent<Engine::Core::AttackTargetComponent>();
+        entity->get_component<Engine::Core::AttackTargetComponent>();
     if ((attack_target != nullptr) && attack_target->target_id != 0) {
 
       continue;
     }
 
     bool enemy_nearby = false;
-    auto all_entities = world->getEntitiesWith<Engine::Core::UnitComponent>();
+    auto all_entities = world->get_entities_with<Engine::Core::UnitComponent>();
     for (auto *other : all_entities) {
-      auto *other_unit = other->getComponent<Engine::Core::UnitComponent>();
+      auto *other_unit = other->get_component<Engine::Core::UnitComponent>();
       auto *other_transform =
-          other->getComponent<Engine::Core::TransformComponent>();
+          other->get_component<Engine::Core::TransformComponent>();
 
       if ((other_unit == nullptr) || (other_transform == nullptr) ||
           other_unit->health <= 0) {
@@ -62,13 +62,13 @@ void PatrolSystem::update(Engine::Core::World *world, float) {
         enemy_nearby = true;
 
         if (attack_target == nullptr) {
-          entity->addComponent<Engine::Core::AttackTargetComponent>();
+          entity->add_component<Engine::Core::AttackTargetComponent>();
           attack_target =
-              entity->getComponent<Engine::Core::AttackTargetComponent>();
+              entity->get_component<Engine::Core::AttackTargetComponent>();
         }
         if (attack_target != nullptr) {
-          attack_target->target_id = other->getId();
-          attack_target->shouldChase = false;
+          attack_target->target_id = other->get_id();
+          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;
   }
 }
 

+ 1 - 1
game/systems/patrol_system.h

@@ -9,7 +9,7 @@ public:
   PatrolSystem() = default;
   ~PatrolSystem() override = default;
 
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 };
 
 } // namespace Game::Systems

+ 57 - 55
game/systems/picking_service.cpp

@@ -11,25 +11,26 @@
 
 namespace Game::Systems {
 
-auto PickingService::worldToScreen(const Render::GL::Camera &cam, int viewW,
-                                   int viewH, const QVector3D &world,
-                                   QPointF &out) -> bool {
-  return cam.worldToScreen(world, qreal(viewW), qreal(viewH), out);
+auto PickingService::world_to_screen(const Render::GL::Camera &cam, int view_w,
+                                     int view_h, const QVector3D &world,
+                                     QPointF &out) -> bool {
+  return cam.world_to_screen(world, qreal(view_w), qreal(view_h), out);
 }
 
-auto PickingService::screenToGround(const Render::GL::Camera &cam, int viewW,
-                                    int viewH, const QPointF &screenPt,
-                                    QVector3D &outWorld) -> bool {
-  if (viewW <= 0 || viewH <= 0) {
+auto PickingService::screen_to_ground(const Render::GL::Camera &cam, int view_w,
+                                      int view_h, const QPointF &screen_pt,
+                                      QVector3D &out_world) -> bool {
+  if (view_w <= 0 || view_h <= 0) {
     return false;
   }
-  return cam.screenToGround(screenPt.x(), screenPt.y(), qreal(viewW),
-                            qreal(viewH), outWorld);
+  return cam.screen_to_ground(screen_pt.x(), screen_pt.y(), qreal(view_w),
+                              qreal(view_h), out_world);
 }
 
-auto PickingService::projectBounds(const Render::GL::Camera &cam,
-                                   const QVector3D &center, float hx, float hz,
-                                   int viewW, int viewH, QRectF &out) -> bool {
+auto PickingService::project_bounds(const Render::GL::Camera &cam,
+                                    const QVector3D &center, float hx, float hz,
+                                    int view_w, int view_h,
+                                    QRectF &out) -> bool {
   QVector3D const corners[4] = {
       QVector3D(center.x() - hx, center.y(), center.z() - hz),
       QVector3D(center.x() + hx, center.y(), center.z() - hz),
@@ -37,7 +38,7 @@ auto PickingService::projectBounds(const Render::GL::Camera &cam,
       QVector3D(center.x() - hx, center.y(), center.z() + hz)};
   QPointF screen_pts[4];
   for (int i = 0; i < 4; ++i) {
-    if (!worldToScreen(cam, viewW, viewH, corners[i], screen_pts[i])) {
+    if (!world_to_screen(cam, view_w, view_h, corners[i], screen_pts[i])) {
       return false;
     }
   }
@@ -55,17 +56,18 @@ auto PickingService::projectBounds(const Render::GL::Camera &cam,
   return true;
 }
 
-auto PickingService::updateHover(float sx, float sy, Engine::Core::World &world,
-                                 const Render::GL::Camera &camera, int viewW,
-                                 int viewH) -> Engine::Core::EntityID {
-  if (sx < 0 || sy < 0 || sx >= viewW || sy >= viewH) {
+auto PickingService::update_hover(float sx, float sy,
+                                  Engine::Core::World &world,
+                                  const Render::GL::Camera &camera, int view_w,
+                                  int view_h) -> Engine::Core::EntityID {
+  if (sx < 0 || sy < 0 || sx >= view_w || sy >= view_h) {
     m_prev_hoverId = 0;
     return 0;
   }
   auto prev_hover = m_prev_hoverId;
 
   Engine::Core::EntityID const picked =
-      pickSingle(sx, sy, world, camera, viewW, viewH, 0, false);
+      pick_single(sx, sy, world, camera, view_w, view_h, 0, false);
 
   if (picked != 0 && picked != prev_hover) {
     m_hoverGraceTicks = 6;
@@ -84,10 +86,10 @@ auto PickingService::updateHover(float sx, float sy, Engine::Core::World &world,
   return current_hover;
 }
 
-auto PickingService::pickSingle(
+auto PickingService::pick_single(
     float sx, float sy, Engine::Core::World &world,
-    const Render::GL::Camera &camera, int viewW, int viewH, int ownerFilter,
-    bool preferBuildingsFirst) -> Engine::Core::EntityID {
+    const Render::GL::Camera &camera, int view_w, int view_h, int owner_filter,
+    bool prefer_buildings_first) -> Engine::Core::EntityID {
 
   const float base_unit_pick_radius = 30.0F;
   const float base_building_pick_radius = 30.0F;
@@ -95,28 +97,28 @@ auto PickingService::pickSingle(
   float best_building_dist2 = std::numeric_limits<float>::max();
   Engine::Core::EntityID best_unit_id = 0;
   Engine::Core::EntityID best_building_id = 0;
-  auto ents = world.getEntitiesWith<Engine::Core::TransformComponent>();
+  auto ents = world.get_entities_with<Engine::Core::TransformComponent>();
   for (auto *e : ents) {
-    if (!e->hasComponent<Engine::Core::UnitComponent>()) {
+    if (!e->has_component<Engine::Core::UnitComponent>()) {
       continue;
     }
-    auto *t = e->getComponent<Engine::Core::TransformComponent>();
-    auto *u = e->getComponent<Engine::Core::UnitComponent>();
+    auto *t = e->get_component<Engine::Core::TransformComponent>();
+    auto *u = e->get_component<Engine::Core::UnitComponent>();
 
-    if (ownerFilter != 0 && u->owner_id != ownerFilter) {
+    if (owner_filter != 0 && u->owner_id != owner_filter) {
       continue;
     }
 
     QPointF sp;
-    if (!camera.worldToScreen(
-            QVector3D(t->position.x, t->position.y, t->position.z), viewW,
-            viewH, sp)) {
+    if (!camera.world_to_screen(
+            QVector3D(t->position.x, t->position.y, t->position.z), view_w,
+            view_h, sp)) {
       continue;
     }
     auto const dx = float(sx - sp.x());
     auto const dy = float(sy - sp.y());
     float const d2 = dx * dx + dy * dy;
-    if (e->hasComponent<Engine::Core::BuildingComponent>()) {
+    if (e->has_component<Engine::Core::BuildingComponent>()) {
       bool hit = false;
       float pick_dist2 = d2;
       const float margin_x_z = 1.6F;
@@ -127,7 +129,7 @@ auto PickingService::pickSingle(
       QPointF pts[8];
       int ok_count = 0;
       auto project = [&](const QVector3D &w, QPointF &out) {
-        return camera.worldToScreen(w, viewW, viewH, out);
+        return camera.world_to_screen(w, view_w, view_h, out);
       };
       ok_count += static_cast<int>(
           project(QVector3D(t->position.x - hx, t->position.y + 0.0F,
@@ -184,17 +186,17 @@ auto PickingService::pickSingle(
       }
       if (hit && pick_dist2 < best_building_dist2) {
         best_building_dist2 = pick_dist2;
-        best_building_id = e->getId();
+        best_building_id = e->get_id();
       }
     } else {
       float const r2 = base_unit_pick_radius * base_unit_pick_radius;
       if (d2 <= r2 && d2 < best_unit_dist2) {
         best_unit_dist2 = d2;
-        best_unit_id = e->getId();
+        best_unit_id = e->get_id();
       }
     }
   }
-  if (preferBuildingsFirst) {
+  if (prefer_buildings_first) {
     if ((best_building_id != 0U) &&
         ((best_unit_id == 0U) || best_building_dist2 <= best_unit_dist2)) {
       return best_building_id;
@@ -213,51 +215,51 @@ auto PickingService::pickSingle(
   return 0;
 }
 
-auto PickingService::pickUnitFirst(float sx, float sy,
-                                   Engine::Core::World &world,
-                                   const Render::GL::Camera &camera, int viewW,
-                                   int viewH,
-                                   int ownerFilter) -> Engine::Core::EntityID {
+auto PickingService::pick_unit_first(
+    float sx, float sy, Engine::Core::World &world,
+    const Render::GL::Camera &camera, int view_w, int view_h,
+    int owner_filter) -> Engine::Core::EntityID {
 
-  auto id = pickSingle(sx, sy, world, camera, viewW, viewH, ownerFilter, false);
+  auto id =
+      pick_single(sx, sy, world, camera, view_w, view_h, owner_filter, false);
   if (id != 0) {
     return id;
   }
 
-  return pickSingle(sx, sy, world, camera, viewW, viewH, ownerFilter, true);
+  return pick_single(sx, sy, world, camera, view_w, view_h, owner_filter, true);
 }
 
-auto PickingService::pickInRect(
+auto PickingService::pick_in_rect(
     float x1, float y1, float x2, float y2, Engine::Core::World &world,
-    const Render::GL::Camera &camera, int viewW, int viewH,
-    int ownerFilter) -> std::vector<Engine::Core::EntityID> {
+    const Render::GL::Camera &camera, int view_w, int view_h,
+    int owner_filter) -> std::vector<Engine::Core::EntityID> {
   float const min_x = std::min(x1, x2);
   float const max_x = std::max(x1, x2);
   float const min_y = std::min(y1, y2);
   float const max_y = std::max(y1, y2);
   std::vector<Engine::Core::EntityID> picked;
-  auto ents = world.getEntitiesWith<Engine::Core::TransformComponent>();
+  auto ents = world.get_entities_with<Engine::Core::TransformComponent>();
   for (auto *e : ents) {
-    if (!e->hasComponent<Engine::Core::UnitComponent>()) {
+    if (!e->has_component<Engine::Core::UnitComponent>()) {
       continue;
     }
-    if (e->hasComponent<Engine::Core::BuildingComponent>()) {
+    if (e->has_component<Engine::Core::BuildingComponent>()) {
       continue;
     }
-    auto *u = e->getComponent<Engine::Core::UnitComponent>();
-    if ((u == nullptr) || u->owner_id != ownerFilter) {
+    auto *u = e->get_component<Engine::Core::UnitComponent>();
+    if ((u == nullptr) || u->owner_id != owner_filter) {
       continue;
     }
-    auto *t = e->getComponent<Engine::Core::TransformComponent>();
+    auto *t = e->get_component<Engine::Core::TransformComponent>();
     QPointF sp;
-    if (!camera.worldToScreen(
-            QVector3D(t->position.x, t->position.y, t->position.z), viewW,
-            viewH, sp)) {
+    if (!camera.world_to_screen(
+            QVector3D(t->position.x, t->position.y, t->position.z), view_w,
+            view_h, sp)) {
       continue;
     }
     if (sp.x() >= min_x && sp.x() <= max_x && sp.y() >= min_y &&
         sp.y() <= max_y) {
-      picked.push_back(e->getId());
+      picked.push_back(e->get_id());
     }
   }
   return picked;

+ 30 - 28
game/systems/picking_service.h

@@ -21,43 +21,45 @@ class PickingService {
 public:
   PickingService() = default;
 
-  auto updateHover(float sx, float sy, Engine::Core::World &world,
-                   const Render::GL::Camera &camera, int viewW,
-                   int viewH) -> Engine::Core::EntityID;
-
-  static auto screenToGround(const Render::GL::Camera &camera, int viewW,
-                             int viewH, const QPointF &screenPt,
-                             QVector3D &outWorld) -> bool;
-  static auto screenToGround(const QPointF &screenPt,
-                             const Render::GL::Camera &camera, int viewW,
-                             int viewH, QVector3D &outWorld) -> bool {
-    return screenToGround(camera, viewW, viewH, screenPt, outWorld);
+  auto update_hover(float sx, float sy, Engine::Core::World &world,
+                    const Render::GL::Camera &camera, int view_w,
+                    int view_h) -> Engine::Core::EntityID;
+
+  static auto screen_to_ground(const Render::GL::Camera &camera, int view_w,
+                               int view_h, const QPointF &screen_pt,
+                               QVector3D &out_world) -> bool;
+  static auto screen_to_ground(const QPointF &screen_pt,
+                               const Render::GL::Camera &camera, int view_w,
+                               int view_h, QVector3D &out_world) -> bool {
+    return screen_to_ground(camera, view_w, view_h, screen_pt, out_world);
   }
-  static auto worldToScreen(const Render::GL::Camera &camera, int viewW,
-                            int viewH, const QVector3D &world,
-                            QPointF &outScreen) -> bool;
+  static auto world_to_screen(const Render::GL::Camera &camera, int view_w,
+                              int view_h, const QVector3D &world,
+                              QPointF &out_screen) -> bool;
 
-  static auto pickSingle(float sx, float sy, Engine::Core::World &world,
-                         const Render::GL::Camera &camera, int viewW, int viewH,
-                         int ownerFilter,
-                         bool preferBuildingsFirst) -> Engine::Core::EntityID;
+  static auto
+  pick_single(float sx, float sy, Engine::Core::World &world,
+              const Render::GL::Camera &camera, int view_w, int view_h,
+              int owner_filter,
+              bool prefer_buildings_first) -> Engine::Core::EntityID;
 
-  static auto pickUnitFirst(float sx, float sy, Engine::Core::World &world,
-                            const Render::GL::Camera &camera, int viewW,
-                            int viewH,
-                            int ownerFilter) -> Engine::Core::EntityID;
+  static auto pick_unit_first(float sx, float sy, Engine::Core::World &world,
+                              const Render::GL::Camera &camera, int view_w,
+                              int view_h,
+                              int owner_filter) -> Engine::Core::EntityID;
 
   static auto
-  pickInRect(float x1, float y1, float x2, float y2, Engine::Core::World &world,
-             const Render::GL::Camera &camera, int viewW, int viewH,
-             int ownerFilter) -> std::vector<Engine::Core::EntityID>;
+  pick_in_rect(float x1, float y1, float x2, float y2,
+               Engine::Core::World &world, const Render::GL::Camera &camera,
+               int view_w, int view_h,
+               int owner_filter) -> std::vector<Engine::Core::EntityID>;
 
 private:
   Engine::Core::EntityID m_prev_hoverId = 0;
   int m_hoverGraceTicks = 0;
-  static auto projectBounds(const Render::GL::Camera &cam,
-                            const QVector3D &center, float hx, float hz,
-                            int viewW, int viewH, QRectF &out) -> bool;
+  static auto project_bounds(const Render::GL::Camera &cam,
+                             const QVector3D &center, float hx, float hz,
+                             int view_w, int view_h, QRectF &out) -> bool;
 };
 
 } // namespace Game::Systems

+ 30 - 30
game/systems/production_service.cpp

@@ -17,8 +17,8 @@ findFirstSelectedBarracks(Engine::Core::World &world,
                           const std::vector<Engine::Core::EntityID> &selected,
                           int owner_id) -> Engine::Core::Entity * {
   for (auto id : selected) {
-    if (auto *e = world.getEntity(id)) {
-      auto *u = e->getComponent<Engine::Core::UnitComponent>();
+    if (auto *e = world.get_entity(id)) {
+      auto *u = e->get_component<Engine::Core::UnitComponent>();
       if ((u == nullptr) || u->owner_id != owner_id) {
         continue;
       }
@@ -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
@@ -63,14 +63,14 @@ auto ProductionService::startProductionForFirstSelectedBarracks(
   if (e == nullptr) {
     return ProductionResult::NoBarracks;
   }
-  auto *unit = e->getComponent<Engine::Core::UnitComponent>();
+  auto *unit = e->get_component<Engine::Core::UnitComponent>();
   const auto nation_id = resolve_nation_id(unit, owner_id);
   const auto profile =
       TroopProfileService::instance().get_profile(nation_id, unit_type);
 
-  auto *p = e->getComponent<Engine::Core::ProductionComponent>();
+  auto *p = e->get_component<Engine::Core::ProductionComponent>();
   if (p == nullptr) {
-    p = e->addComponent<Engine::Core::ProductionComponent>();
+    p = e->add_component<Engine::Core::ProductionComponent>();
   }
   if (p == nullptr) {
     return ProductionResult::NoBarracks;
@@ -78,32 +78,32 @@ 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;
   }
 
   int const current_troops =
-      Engine::Core::World::countTroopsForPlayer(owner_id);
+      Engine::Core::World::count_troops_for_player(owner_id);
   int const max_troops = Game::GameConfig::instance().getMaxTroopsPerPlayer();
   if (current_troops + individuals_per_unit > max_troops) {
     return ProductionResult::GlobalTroopLimitReached;
   }
 
   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;
@@ -117,16 +117,16 @@ auto ProductionService::setRallyForFirstSelectedBarracks(
   if (e == nullptr) {
     return false;
   }
-  auto *p = e->getComponent<Engine::Core::ProductionComponent>();
+  auto *p = e->get_component<Engine::Core::ProductionComponent>();
   if (p == nullptr) {
-    p = e->addComponent<Engine::Core::ProductionComponent>();
+    p = e->add_component<Engine::Core::ProductionComponent>();
   }
   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;
 }
 
@@ -140,21 +140,21 @@ auto ProductionService::getSelectedBarracksState(
     return false;
   }
   outState.has_barracks = true;
-  if (auto *unit = e->getComponent<Engine::Core::UnitComponent>()) {
+  if (auto *unit = e->get_component<Engine::Core::UnitComponent>()) {
     outState.nation_id = resolve_nation_id(unit, owner_id);
   } else {
     outState.nation_id = NationRegistry::instance().default_nation_id();
   }
-  if (auto *p = e->getComponent<Engine::Core::ProductionComponent>()) {
-    outState.inProgress = p->inProgress;
+  if (auto *p = e->get_component<Engine::Core::ProductionComponent>()) {
+    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.queue_size = static_cast<int>(p->production_queue.size());
+    outState.production_queue = p->production_queue;
   }
   return true;
 }

+ 8 - 8
game/systems/production_service.h

@@ -23,16 +23,16 @@ enum class ProductionResult {
 
 struct ProductionState {
   bool has_barracks = false;
-  bool inProgress = false;
+  bool in_progress = false;
   NationID nation_id = NationID::RomanRepublic;
   Game::Units::TroopType product_type = Game::Units::TroopType::Archer;
-  float timeRemaining = 0.0F;
-  float buildTime = 0.0F;
-  int producedCount = 0;
-  int maxUnits = 0;
-  int villagerCost = 1;
-  int queueSize = 0;
-  std::vector<Game::Units::TroopType> productionQueue;
+  float time_remaining = 0.0F;
+  float build_time = 0.0F;
+  int produced_count = 0;
+  int max_units = 0;
+  int villager_cost = 1;
+  int queue_size = 0;
+  std::vector<Game::Units::TroopType> production_queue;
 };
 
 class ProductionService {

+ 30 - 30
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,
@@ -40,24 +40,24 @@ auto resolve_nation_id(const Engine::Core::UnitComponent *unit,
 
 } // namespace
 
-void ProductionSystem::update(Engine::Core::World *world, float deltaTime) {
+void ProductionSystem::update(Engine::Core::World *world, float delta_time) {
   if (world == nullptr) {
     return;
   }
-  auto entities = world->getEntitiesWith<Engine::Core::ProductionComponent>();
+  auto entities = world->get_entities_with<Engine::Core::ProductionComponent>();
   for (auto *e : entities) {
-    auto *prod = e->getComponent<Engine::Core::ProductionComponent>();
+    auto *prod = e->get_component<Engine::Core::ProductionComponent>();
     if (prod == nullptr) {
       continue;
     }
 
-    auto *unit_comp = e->getComponent<Engine::Core::UnitComponent>();
+    auto *unit_comp = e->get_component<Engine::Core::UnitComponent>();
     if ((unit_comp != nullptr) &&
         Game::Core::isNeutralOwner(unit_comp->owner_id)) {
       continue;
     }
 
-    if (!prod->inProgress) {
+    if (!prod->in_progress) {
       continue;
     }
 
@@ -67,29 +67,29 @@ 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 -= delta_time;
+    if (prod->time_remaining <= 0.0F) {
 
-      auto *t = e->getComponent<Engine::Core::TransformComponent>();
-      auto *u = e->getComponent<Engine::Core::UnitComponent>();
+      auto *t = e->get_component<Engine::Core::TransformComponent>();
+      auto *u = e->get_component<Engine::Core::UnitComponent>();
       if ((t != nullptr) && (u != nullptr)) {
 
         int const current_troops =
-            Engine::Core::World::countTroopsForPlayer(u->owner_id);
+            Engine::Core::World::count_troops_for_player(u->owner_id);
         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));
@@ -101,28 +101,28 @@ void ProductionSystem::update(Engine::Core::World *world, float deltaTime) {
           sp.player_id = u->owner_id;
           sp.spawn_type =
               Game::Units::spawn_typeFromTroopType(prod->product_type);
-          sp.aiControlled =
-              e->hasComponent<Engine::Core::AIControlledComponent>();
+          sp.ai_controlled =
+              e->has_component<Engine::Core::AIControlledComponent>();
           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;
       }
     }
   }

+ 1 - 1
game/systems/production_system.h

@@ -6,7 +6,7 @@ namespace Game::Systems {
 
 class ProductionSystem : public Engine::Core::System {
 public:
-  void update(Engine::Core::World *world, float deltaTime) override;
+  void update(Engine::Core::World *world, float delta_time) override;
 };
 
 } // namespace Game::Systems

+ 79 - 75
game/systems/selection_system.cpp

@@ -17,32 +17,34 @@
 
 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,
-                                        float y2) {}
+void SelectionSystem::select_units_in_area(float x1, float y1, float x2,
+                                           float y2) {}
 
-auto SelectionSystem::isUnitInArea(Engine::Core::Entity *entity, float x1,
-                                   float y1, float x2, float y2) -> bool {
-  auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
+auto SelectionSystem::is_unit_in_area(Engine::Core::Entity *entity, float x1,
+                                      float y1, float x2, float y2) -> bool {
+  auto *transform = entity->get_component<Engine::Core::TransformComponent>();
   if (transform == nullptr) {
     return false;
   }
@@ -59,88 +61,90 @@ 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;
   }
 
   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);
+      Game::Systems::PickingService::pick_single(
+          float(sx), float(sy), *m_world, *cam, viewport_width, viewport_height,
+          local_owner_id, true);
 
   if (picked != 0U) {
 
     if (!additive) {
-      m_selection_system->clearSelection();
+      m_selection_system->clear_selection();
     }
-    m_selection_system->selectUnit(picked);
-    syncSelectionFlags();
-    emit selectionChanged();
+    m_selection_system->select_unit(picked);
+    sync_selection_flags();
+    emit selection_changed();
     return;
   }
 
-  if (!additive && !m_selection_system->getSelectedUnits().empty()) {
-    m_selection_system->clearSelection();
-    syncSelectionFlags();
-    emit selectionChanged();
+  if (!additive && !m_selection_system->get_selected_units().empty()) {
+    m_selection_system->clear_selection();
+    sync_selection_flags();
+    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;
   }
 
   if (!additive) {
-    m_selection_system->clearSelection();
+    m_selection_system->clear_selection();
   }
 
   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);
+  auto picked = Game::Systems::PickingService::pick_in_rect(
+      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);
+    m_selection_system->select_unit(id);
   }
-  syncSelectionFlags();
-  emit selectionChanged();
+  sync_selection_flags();
+  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();
+  m_selection_system->clear_selection();
+  sync_selection_flags();
+  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;
   }
 
-  m_selection_system->clearSelection();
+  m_selection_system->clear_selection();
 
-  auto entities = m_world->getEntitiesWith<Engine::Core::UnitComponent>();
+  auto entities = m_world->get_entities_with<Engine::Core::UnitComponent>();
   for (auto *e : entities) {
-    auto *unit = e->getComponent<Engine::Core::UnitComponent>();
-    if ((unit == nullptr) || unit->owner_id != localOwnerId) {
+    auto *unit = e->get_component<Engine::Core::UnitComponent>();
+    if ((unit == nullptr) || unit->owner_id != local_owner_id) {
       continue;
     }
 
-    if (e->hasComponent<Engine::Core::BuildingComponent>()) {
+    if (e->has_component<Engine::Core::BuildingComponent>()) {
       continue;
     }
 
@@ -148,62 +152,62 @@ void SelectionController::selectAllPlayerTroops(int localOwnerId) {
       continue;
     }
 
-    m_selection_system->selectUnit(e->getId());
+    m_selection_system->select_unit(e->get_id());
   }
 
-  syncSelectionFlags();
-  emit selectionChanged();
+  sync_selection_flags();
+  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;
   }
 
-  auto *entity = m_world->getEntity(id);
+  auto *entity = m_world->get_entity(id);
   if (entity == nullptr) {
     return;
   }
 
-  auto *unit = entity->getComponent<Engine::Core::UnitComponent>();
+  auto *unit = entity->get_component<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();
+  m_selection_system->clear_selection();
+  m_selection_system->select_unit(id);
+  sync_selection_flags();
+  emit selection_changed();
 }
 
-auto SelectionController::hasUnitsSelected() const -> bool {
+auto SelectionController::has_units_selected() const -> bool {
   if (m_selection_system == nullptr) {
     return false;
   }
-  const auto &sel = m_selection_system->getSelectedUnits();
+  const auto &sel = m_selection_system->get_selected_units();
   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) {
     return;
   }
-  const auto &ids = m_selection_system->getSelectedUnits();
+  const auto &ids = m_selection_system->get_selected_units();
   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;
   }
-  const auto &sel = m_selection_system->getSelectedUnits();
+  const auto &sel = m_selection_system->get_selected_units();
   for (auto id : sel) {
-    if (auto *e = m_world->getEntity(id)) {
-      if (auto *u = e->getComponent<Engine::Core::UnitComponent>()) {
+    if (auto *e = m_world->get_entity(id)) {
+      if (auto *u = e->get_component<Engine::Core::UnitComponent>()) {
         if (QString::fromStdString(
                 Game::Units::spawn_typeToString(u->spawn_type)) == type) {
           return true;
@@ -214,11 +218,11 @@ 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;
   }
-  App::Utils::sanitizeSelection(m_world, m_selection_system);
+  App::Utils::sanitize_selection(m_world, m_selection_system);
 }
 
 } // namespace Game::Systems

+ 26 - 26
game/systems/selection_system.h

@@ -17,22 +17,22 @@ 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,
-                           float x2, float y2) -> bool;
+  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;
 };
 
 class SelectionController : public QObject {
@@ -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

+ 3 - 3
game/systems/terrain_alignment_system.cpp

@@ -14,7 +14,7 @@ void TerrainAlignmentSystem::update(Engine::Core::World *world, float) {
     return;
   }
 
-  auto entities = world->getEntitiesWith<Engine::Core::TransformComponent>();
+  auto entities = world->get_entities_with<Engine::Core::TransformComponent>();
   for (auto *entity : entities) {
     alignEntityToTerrain(entity);
   }
@@ -22,7 +22,7 @@ void TerrainAlignmentSystem::update(Engine::Core::World *world, float) {
 
 void TerrainAlignmentSystem::alignEntityToTerrain(
     Engine::Core::Entity *entity) {
-  auto *transform = entity->getComponent<Engine::Core::TransformComponent>();
+  auto *transform = entity->get_component<Engine::Core::TransformComponent>();
   if (transform == nullptr) {
     return;
   }
@@ -33,7 +33,7 @@ void TerrainAlignmentSystem::alignEntityToTerrain(
       transform->position.x, transform->position.z);
 
   float entity_base_offset = 0.0F;
-  if (auto *unit = entity->getComponent<Engine::Core::UnitComponent>()) {
+  if (auto *unit = entity->get_component<Engine::Core::UnitComponent>()) {
     entity_base_offset =
         Game::Units::TroopConfig::instance().getSelectionRingGroundOffset(
             unit->spawn_type);

Some files were not shown because too many files changed in this diff