Browse Source

Fix compilation errors

djeada 1 week ago
parent
commit
6ce04d0214
81 changed files with 1013 additions and 933 deletions
  1. 2 2
      README.md
  2. 11 11
      app/controllers/command_controller.cpp
  3. 136 123
      app/core/game_engine.cpp
  4. 26 21
      app/core/game_engine.h
  5. 2 2
      app/models/cursor_manager.cpp
  6. 2 2
      app/models/cursor_manager.h
  7. 2 1
      app/models/graphics_settings_proxy.h
  8. 4 4
      app/models/hover_tracker.cpp
  9. 3 3
      app/models/hover_tracker.h
  10. 12 12
      app/utils/engine_view_helpers.h
  11. 4 4
      app/utils/selection_utils.h
  12. 2 2
      game/audio/AudioSystem.cpp
  13. 1 1
      game/core/component.h
  14. 1 1
      game/core/entity.cpp
  15. 2 2
      game/core/event_manager.h
  16. 97 94
      game/core/serialization.cpp
  17. 12 11
      game/core/world.cpp
  18. 6 6
      game/map/level_loader.cpp
  19. 4 4
      game/map/level_loader.h
  20. 1 1
      game/map/map_definition.h
  21. 5 5
      game/map/skirmish_loader.cpp
  22. 4 4
      game/map/skirmish_loader.h
  23. 5 5
      game/map/world_bootstrap.cpp
  24. 5 5
      game/map/world_bootstrap.h
  25. 14 14
      game/systems/ai_system/ai_types.h
  26. 1 1
      game/systems/arrow_system.cpp
  27. 2 2
      game/systems/camera_follow_system.cpp
  28. 10 10
      game/systems/camera_service.cpp
  29. 6 6
      game/systems/camera_service.h
  30. 4 2
      game/systems/capture_system.cpp
  31. 28 15
      game/systems/combat_system.cpp
  32. 1 1
      game/systems/combat_system.h
  33. 2 1
      game/systems/formation_system.cpp
  34. 5 4
      game/systems/game_state_serializer.cpp
  35. 2 1
      game/systems/game_state_serializer.h
  36. 2 1
      game/systems/global_stats_registry.cpp
  37. 4 0
      game/systems/global_stats_registry.h
  38. 1 1
      game/systems/movement_system.cpp
  39. 3 3
      game/systems/movement_system.h
  40. 1 1
      game/systems/nation_loader.cpp
  41. 7 7
      game/systems/nation_registry.cpp
  42. 2 1
      game/systems/nation_registry.h
  43. 4 3
      game/systems/pathfinding.cpp
  44. 2 2
      game/systems/pathfinding.h
  45. 20 18
      game/systems/picking_service.cpp
  46. 23 21
      game/systems/picking_service.h
  47. 41 37
      game/systems/selection_system.cpp
  48. 4 4
      game/systems/selection_system.h
  49. 2 1
      game/systems/troop_count_registry.cpp
  50. 6 5
      game/units/archer.cpp
  51. 6 5
      game/units/ballista.cpp
  52. 6 5
      game/units/catapult.cpp
  53. 6 5
      game/units/horse_archer.cpp
  54. 6 5
      game/units/horse_spearman.cpp
  55. 6 5
      game/units/horse_swordsman.cpp
  56. 6 5
      game/units/spearman.cpp
  57. 6 5
      game/units/swordsman.cpp
  58. 2 2
      game/units/unit.cpp
  59. 1 1
      render/entity/mounted_humanoid_renderer_base.cpp
  60. 2 1
      render/entity/nations/carthage/ballista_renderer.cpp
  61. 2 1
      render/entity/nations/carthage/catapult_renderer.cpp
  62. 40 40
      render/entity/nations/roman/ballista_renderer.cpp
  63. 31 31
      render/entity/nations/roman/catapult_renderer.cpp
  64. 1 1
      render/entity/registry.h
  65. 2 2
      render/geom/arrow.cpp
  66. 2 1
      render/geom/patrol_flags.cpp
  67. 5 5
      render/gl/camera.cpp
  68. 9 7
      render/gl/camera.h
  69. 4 3
      render/gl/humanoid/animation/animation_inputs.cpp
  70. 64 59
      render/graphics_settings.h
  71. 5 4
      render/humanoid/rig.cpp
  72. 2 2
      render/scene_renderer.cpp
  73. 186 184
      tests/core/serialization_test.cpp
  74. 3 3
      ui/qml/GameView.qml
  75. 1 1
      ui/qml/HUD.qml
  76. 1 1
      ui/qml/HUDBottom.qml
  77. 1 1
      ui/qml/HUDVictory.qml
  78. 1 1
      ui/qml/LoadGamePanel.qml
  79. 1 1
      ui/qml/Main.qml
  80. 58 57
      ui/qml/ProductionPanel.qml
  81. 1 1
      ui/qml/SaveGamePanel.qml

+ 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...
     }

+ 11 - 11
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;
@@ -78,7 +78,7 @@ 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;
   }
@@ -100,7 +100,7 @@ auto CommandController::onStopCommand() -> CommandResult {
     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,7 +116,7 @@ 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;
   }
@@ -139,7 +139,7 @@ auto CommandController::onHoldCommand() -> CommandResult {
 
     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;
     }
@@ -156,7 +156,7 @@ auto CommandController::onHoldCommand() -> CommandResult {
       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->get_component<Engine::Core::MovementComponent>();
@@ -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();
@@ -268,7 +268,7 @@ auto CommandController::setRallyAtScreen(qreal sx, qreal sy, int viewportWidth,
   }
 
   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,7 +304,7 @@ 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->get_entity(entity_id);
     if (entity == nullptr) {

+ 136 - 123
app/core/game_engine.cpp

@@ -155,7 +155,8 @@ GameEngine::GameEngine(QObject *parent)
   m_world->add_system(std::make_unique<Game::Systems::CaptureSystem>());
   m_world->add_system(std::make_unique<Game::Systems::AISystem>());
   m_world->add_system(std::make_unique<Game::Systems::ProductionSystem>());
-  m_world->add_system(std::make_unique<Game::Systems::TerrainAlignmentSystem>());
+  m_world->add_system(
+      std::make_unique<Game::Systems::TerrainAlignmentSystem>());
   m_world->add_system(std::make_unique<Game::Systems::CleanupSystem>());
 
   {
@@ -169,7 +170,8 @@ GameEngine::GameEngine(QObject *parent)
   m_saveLoadService = std::make_unique<Game::Systems::SaveLoadService>();
   m_cameraService = std::make_unique<Game::Systems::CameraService>();
 
-  auto *selection_system = m_world->get_system<Game::Systems::SelectionSystem>();
+  auto *selection_system =
+      m_world->get_system<Game::Systems::SelectionSystem>();
   m_selectionController = std::make_unique<Game::Systems::SelectionController>(
       m_world.get(), selection_system, m_pickingService.get());
   m_commandController = std::make_unique<App::Controllers::CommandController>(
@@ -238,15 +240,16 @@ GameEngine::GameEngine(QObject *parent)
   connect(m_selectionController.get(),
           &Game::Systems::SelectionController::selection_changed, this,
           &GameEngine::sync_selection_flags);
-  connect(m_selectionController.get(),
-          &Game::Systems::SelectionController::selection_model_refresh_requested,
-          this, &GameEngine::selected_units_data_changed);
+  connect(
+      m_selectionController.get(),
+      &Game::Systems::SelectionController::selection_model_refresh_requested,
+      this, &GameEngine::selected_units_data_changed);
   connect(m_commandController.get(),
           &App::Controllers::CommandController::attack_targetSelected,
           [this]() {
             if (auto *sel_sys =
                     m_world->get_system<Game::Systems::SelectionSystem>()) {
-              const auto &sel = sel_sys->getSelectedUnits();
+              const auto &sel = sel_sys->get_selected_units();
               if (!sel.empty()) {
                 auto *cam = m_camera.get();
                 auto *picking = m_pickingService.get();
@@ -266,7 +269,8 @@ GameEngine::GameEngine(QObject *parent)
 
   connect(m_commandController.get(),
           &App::Controllers::CommandController::troopLimitReached, [this]() {
-            set_error("Maximum troop limit reached. Cannot produce more units.");
+            set_error(
+                "Maximum troop limit reached. Cannot produce more units.");
           });
   connect(m_commandController.get(),
           &App::Controllers::CommandController::hold_modeChanged, this,
@@ -283,7 +287,7 @@ GameEngine::GameEngine(QObject *parent)
       Engine::Core::ScopedEventSubscription<Engine::Core::UnitDiedEvent>(
           [this](const Engine::Core::UnitDiedEvent &e) {
             on_unit_died(e);
-            if (e.owner_id != m_runtime.localOwnerId) {
+            if (e.owner_id != m_runtime.local_owner_id) {
 
               int const individuals_per_unit =
                   Game::Units::TroopConfig::instance().getIndividualsPerUnit(
@@ -352,9 +356,9 @@ void GameEngine::on_map_clicked(qreal sx, qreal sy) {
   }
   ensure_initialized();
   if (m_selectionController && m_camera) {
-    m_selectionController->onClickSelect(sx, sy, false, m_viewport.width,
-                                         m_viewport.height, m_camera.get(),
-                                         m_runtime.localOwnerId);
+    m_selectionController->on_click_select(sx, sy, false, m_viewport.width,
+                                           m_viewport.height, m_camera.get(),
+                                           m_runtime.local_owner_id);
   }
 }
 
@@ -363,7 +367,8 @@ void GameEngine::on_right_click(qreal sx, qreal sy) {
     return;
   }
   ensure_initialized();
-  auto *selection_system = m_world->get_system<Game::Systems::SelectionSystem>();
+  auto *selection_system =
+      m_world->get_system<Game::Systems::SelectionSystem>();
   if (selection_system == nullptr) {
     return;
   }
@@ -374,14 +379,14 @@ void GameEngine::on_right_click(qreal sx, qreal sy) {
     return;
   }
 
-  const auto &sel = selection_system->getSelectedUnits();
+  const auto &sel = selection_system->get_selected_units();
   if (sel.empty()) {
 
     return;
   }
 
   if (m_pickingService && m_camera) {
-    Engine::Core::EntityID const target_id = m_pickingService->pickUnitFirst(
+    Engine::Core::EntityID const target_id = m_pickingService->pick_unit_first(
         float(sx), float(sy), *m_world, *m_camera, m_viewport.width,
         m_viewport.height, 0);
 
@@ -393,7 +398,7 @@ void GameEngine::on_right_click(qreal sx, qreal sy) {
         if (target_unit != nullptr) {
 
           bool const is_enemy =
-              (target_unit->owner_id != m_runtime.localOwnerId);
+              (target_unit->owner_id != m_runtime.local_owner_id);
 
           if (is_enemy) {
 
@@ -408,14 +413,14 @@ void GameEngine::on_right_click(qreal sx, qreal sy) {
 
   if (m_pickingService && m_camera) {
     QVector3D hit;
-    if (m_pickingService->screenToGround(QPointF(sx, sy), *m_camera,
-                                         m_viewport.width, m_viewport.height,
-                                         hit)) {
+    if (m_pickingService->screen_to_ground(QPointF(sx, sy), *m_camera,
+                                           m_viewport.width, m_viewport.height,
+                                           hit)) {
       auto targets = Game::Systems::FormationPlanner::spreadFormation(
           int(sel.size()), hit,
           Game::GameConfig::instance().gameplay().formationSpacingDefault);
       Game::Systems::CommandService::MoveOptions opts;
-      opts.groupMove = sel.size() > 1;
+      opts.group_move = sel.size() > 1;
       Game::Systems::CommandService::moveUnits(*m_world, sel, targets, opts);
     }
   }
@@ -433,15 +438,16 @@ void GameEngine::on_attack_click(qreal sx, qreal sy) {
   auto result = m_commandController->onAttackClick(
       sx, sy, m_viewport.width, m_viewport.height, m_camera.get());
 
-  auto *selection_system = m_world->get_system<Game::Systems::SelectionSystem>();
+  auto *selection_system =
+      m_world->get_system<Game::Systems::SelectionSystem>();
   if ((selection_system == nullptr) || !m_pickingService || !m_camera ||
       !m_world) {
     return;
   }
 
-  const auto &selected = selection_system->getSelectedUnits();
+  const auto &selected = selection_system->get_selected_units();
   if (!selected.empty()) {
-    Engine::Core::EntityID const target_id = m_pickingService->pickUnitFirst(
+    Engine::Core::EntityID const target_id = m_pickingService->pick_unit_first(
         float(sx), float(sy), *m_world, *m_camera, m_viewport.width,
         m_viewport.height, 0);
 
@@ -451,7 +457,7 @@ void GameEngine::on_attack_click(qreal sx, qreal sy) {
         auto *target_unit =
             target_entity->get_component<Engine::Core::UnitComponent>();
         if ((target_unit != nullptr) &&
-            target_unit->owner_id != m_runtime.localOwnerId) {
+            target_unit->owner_id != m_runtime.local_owner_id) {
           App::Controllers::ActionVFX::spawnAttackArrow(m_world.get(),
                                                         target_id);
         }
@@ -516,15 +522,15 @@ void GameEngine::update_cursor(Qt::CursorShape newCursor) {
   if (m_window == nullptr) {
     return;
   }
-  if (m_runtime.currentCursor != newCursor) {
-    m_runtime.currentCursor = newCursor;
+  if (m_runtime.current_cursor != newCursor) {
+    m_runtime.current_cursor = newCursor;
     m_window->setCursor(newCursor);
   }
 }
 
 void GameEngine::set_error(const QString &errorMessage) {
-  if (m_runtime.lastError != errorMessage) {
-    m_runtime.lastError = errorMessage;
+  if (m_runtime.last_error != errorMessage) {
+    m_runtime.last_error = errorMessage;
     qCritical() << "GameEngine error:" << errorMessage;
     emit last_error_changed();
   }
@@ -553,14 +559,14 @@ auto GameEngine::global_cursor_x() const -> qreal {
   if (!m_cursorManager) {
     return 0;
   }
-  return m_cursorManager->globalCursorX(m_window);
+  return m_cursorManager->global_cursor_x(m_window);
 }
 
 auto GameEngine::global_cursor_y() const -> qreal {
   if (!m_cursorManager) {
     return 0;
   }
-  return m_cursorManager->globalCursorY(m_window);
+  return m_cursorManager->global_cursor_y(m_window);
 }
 
 void GameEngine::set_hover_at_screen(qreal sx, qreal sy) {
@@ -575,7 +581,7 @@ void GameEngine::set_hover_at_screen(qreal sx, qreal sy) {
   m_cursorManager->updateCursorShape(m_window);
 
   m_hoverTracker->update_hover(float(sx), float(sy), *m_world, *m_camera,
-                              m_viewport.width, m_viewport.height);
+                               m_viewport.width, m_viewport.height);
 }
 
 void GameEngine::on_click_select(qreal sx, qreal sy, bool additive) {
@@ -584,29 +590,29 @@ void GameEngine::on_click_select(qreal sx, qreal sy, bool additive) {
   }
   ensure_initialized();
   if (m_selectionController && m_camera) {
-    m_selectionController->onClickSelect(sx, sy, additive, m_viewport.width,
-                                         m_viewport.height, m_camera.get(),
-                                         m_runtime.localOwnerId);
+    m_selectionController->on_click_select(sx, sy, additive, m_viewport.width,
+                                           m_viewport.height, m_camera.get(),
+                                           m_runtime.local_owner_id);
   }
 }
 
 void GameEngine::on_area_selected(qreal x1, qreal y1, qreal x2, qreal y2,
-                                bool additive) {
+                                  bool additive) {
   if (m_window == nullptr) {
     return;
   }
   ensure_initialized();
   if (m_selectionController && m_camera) {
-    m_selectionController->onAreaSelected(
+    m_selectionController->on_area_selected(
         x1, y1, x2, y2, additive, m_viewport.width, m_viewport.height,
-        m_camera.get(), m_runtime.localOwnerId);
+        m_camera.get(), m_runtime.local_owner_id);
   }
 }
 
 void GameEngine::select_all_troops() {
   ensure_initialized();
   if (m_selectionController) {
-    m_selectionController->selectAllPlayerTroops(m_runtime.localOwnerId);
+    m_selectionController->select_all_player_troops(m_runtime.local_owner_id);
   }
 }
 
@@ -615,8 +621,8 @@ void GameEngine::select_unit_by_id(int unitId) {
   if (!m_selectionController || (unitId <= 0)) {
     return;
   }
-  m_selectionController->selectSingleUnit(
-      static_cast<Engine::Core::EntityID>(unitId), m_runtime.localOwnerId);
+  m_selectionController->select_single_unit(
+      static_cast<Engine::Core::EntityID>(unitId), m_runtime.local_owner_id);
 }
 
 void GameEngine::ensure_initialized() {
@@ -664,7 +670,7 @@ void GameEngine::update(float dt) {
   if (m_runtime.paused) {
     dt = 0.0F;
   } else {
-    dt *= m_runtime.timeScale;
+    dt *= m_runtime.time_scale;
   }
 
   if (!m_runtime.paused && !m_runtime.loading) {
@@ -690,7 +696,7 @@ void GameEngine::update(float dt) {
           Game::GameConfig::instance().gameplay().visibility_update_interval;
       if (m_runtime.visibilityUpdateAccumulator >= visibility_update_interval) {
         m_runtime.visibilityUpdateAccumulator = 0.0F;
-        visibility_service.update(*m_world, m_runtime.localOwnerId);
+        visibility_service.update(*m_world, m_runtime.local_owner_id);
       }
 
       const auto new_version = visibility_service.version();
@@ -711,15 +717,15 @@ void GameEngine::update(float dt) {
   }
 
   if (m_followSelectionEnabled && m_camera && m_world && m_cameraService) {
-    m_cameraService->updateFollow(*m_camera, *m_world,
-                                  m_followSelectionEnabled);
+    m_cameraService->update_follow(*m_camera, *m_world,
+                                   m_followSelectionEnabled);
   }
 
   if (m_selectedUnitsModel != nullptr) {
     auto *selection_system =
         m_world->get_system<Game::Systems::SelectionSystem>();
     if ((selection_system != nullptr) &&
-        !selection_system->getSelectedUnits().empty()) {
+        !selection_system->get_selected_units().empty()) {
       m_runtime.selectionRefreshCounter++;
       if (m_runtime.selectionRefreshCounter >= 15) {
         m_runtime.selectionRefreshCounter = 0;
@@ -741,7 +747,7 @@ void GameEngine::render(int pixelWidth, int pixelHeight) {
   }
   if (auto *selection_system =
           m_world->get_system<Game::Systems::SelectionSystem>()) {
-    const auto &sel = selection_system->getSelectedUnits();
+    const auto &sel = selection_system->get_selected_units();
     std::vector<unsigned int> const ids(sel.begin(), sel.end());
     m_renderer->setSelectedEntities(ids);
   }
@@ -757,7 +763,7 @@ void GameEngine::render(int pixelWidth, int pixelHeight) {
     m_renderer->setHoveredEntityId(m_hoverTracker->getLastHoveredEntity());
   }
   if (m_renderer) {
-    m_renderer->setLocalOwnerId(m_runtime.localOwnerId);
+    m_renderer->setLocalOwnerId(m_runtime.local_owner_id);
   }
   m_renderer->renderWorld(m_world.get());
   if (auto *arrow_system = m_world->get_system<Game::Systems::ArrowSystem>()) {
@@ -776,8 +782,8 @@ void GameEngine::render(int pixelWidth, int pixelHeight) {
   }
   m_renderer->endFrame();
 
-  qreal const current_x = globalCursorX();
-  qreal const current_y = globalCursorY();
+  qreal const current_x = global_cursor_x();
+  qreal const current_y = global_cursor_y();
   if (current_x != m_runtime.lastCursorX ||
       current_y != m_runtime.lastCursorY) {
     m_runtime.lastCursorX = current_x;
@@ -787,28 +793,29 @@ void GameEngine::render(int pixelWidth, int pixelHeight) {
 }
 
 auto GameEngine::screen_to_ground(const QPointF &screenPt,
-                                QVector3D &outWorld) -> bool {
+                                  QVector3D &outWorld) -> bool {
   return App::Utils::screen_to_ground(m_pickingService.get(), m_camera.get(),
-                                    m_window, m_viewport.width,
-                                    m_viewport.height, screenPt, outWorld);
+                                      m_window, m_viewport.width,
+                                      m_viewport.height, screenPt, outWorld);
 }
 
 auto GameEngine::world_to_screen(const QVector3D &world,
-                               QPointF &outScreen) const -> bool {
+                                 QPointF &outScreen) const -> bool {
   return App::Utils::world_to_screen(m_pickingService.get(), m_camera.get(),
-                                   m_window, m_viewport.width,
-                                   m_viewport.height, world, outScreen);
+                                     m_window, m_viewport.width,
+                                     m_viewport.height, world, outScreen);
 }
 
 void GameEngine::sync_selection_flags() {
-  auto *selection_system = m_world->get_system<Game::Systems::SelectionSystem>();
+  auto *selection_system =
+      m_world->get_system<Game::Systems::SelectionSystem>();
   if (!m_world || (selection_system == nullptr)) {
     return;
   }
 
   App::Utils::sanitize_selection(m_world.get(), selection_system);
 
-  if (selection_system->getSelectedUnits().empty()) {
+  if (selection_system->get_selected_units().empty()) {
     if (m_cursorManager && m_cursorManager->mode() != CursorMode::Normal) {
       set_cursor_mode(CursorMode::Normal);
     }
@@ -839,7 +846,7 @@ void GameEngine::reset_camera() {
     return;
   }
 
-  m_cameraService->resetCamera(*m_camera, *m_world, m_runtime.localOwnerId,
+  m_cameraService->resetCamera(*m_camera, *m_world, m_runtime.local_owner_id,
                                m_level.player_unit_id);
 }
 
@@ -856,7 +863,7 @@ auto GameEngine::camera_distance() const -> float {
   if (!m_camera || !m_cameraService) {
     return 0.0F;
   }
-  return m_cameraService->getDistance(*m_camera);
+  return m_cameraService->get_distance(*m_camera);
 }
 
 void GameEngine::camera_yaw(float degrees) {
@@ -883,12 +890,12 @@ void GameEngine::camera_orbit(float yaw_deg, float pitch_deg) {
   m_cameraService->orbit(*m_camera, yaw_deg, pitch_deg);
 }
 
-void GameEngine::camera_orbitDirection(int direction, bool shift) {
+void GameEngine::camera_orbit_direction(int direction, bool shift) {
   if (!m_camera || !m_cameraService) {
     return;
   }
 
-  m_cameraService->orbitDirection(*m_camera, direction, shift);
+  m_cameraService->orbit_direction(*m_camera, direction, shift);
 }
 
 void GameEngine::camera_follow_selection(bool enable) {
@@ -922,7 +929,7 @@ auto GameEngine::has_units_selected() const -> bool {
   if (!m_selectionController) {
     return false;
   }
-  return m_selectionController->hasUnitsSelected();
+  return m_selectionController->has_units_selected();
 }
 
 auto GameEngine::player_troop_count() const -> int {
@@ -933,7 +940,7 @@ auto GameEngine::has_selected_type(const QString &type) const -> bool {
   if (!m_selectionController) {
     return false;
   }
-  return m_selectionController->hasSelectedType(type);
+  return m_selectionController->has_selected_type(type);
 }
 
 void GameEngine::recruit_near_selected(const QString &unit_type) {
@@ -941,39 +948,40 @@ void GameEngine::recruit_near_selected(const QString &unit_type) {
   if (!m_commandController) {
     return;
   }
-  m_commandController->recruitNearSelected(unit_type, m_runtime.localOwnerId);
+  m_commandController->recruitNearSelected(unit_type, m_runtime.local_owner_id);
 }
 
 auto GameEngine::get_selected_production_state() const -> QVariantMap {
   QVariantMap m;
   m["has_barracks"] = false;
-  m["inProgress"] = false;
-  m["timeRemaining"] = 0.0;
-  m["buildTime"] = 0.0;
-  m["producedCount"] = 0;
-  m["maxUnits"] = 0;
-  m["villagerCost"] = 1;
+  m["in_progress"] = false;
+  m["time_remaining"] = 0.0;
+  m["build_time"] = 0.0;
+  m["produced_count"] = 0;
+  m["max_units"] = 0;
+  m["villager_cost"] = 1;
   if (!m_world) {
     return m;
   }
-  auto *selection_system = m_world->get_system<Game::Systems::SelectionSystem>();
+  auto *selection_system =
+      m_world->get_system<Game::Systems::SelectionSystem>();
   if (selection_system == nullptr) {
     return m;
   }
   Game::Systems::ProductionState st;
   Game::Systems::ProductionService::getSelectedBarracksState(
-      *m_world, selection_system->getSelectedUnits(), m_runtime.localOwnerId,
-      st);
+      *m_world, selection_system->get_selected_units(),
+      m_runtime.local_owner_id, st);
   m["has_barracks"] = st.has_barracks;
-  m["inProgress"] = st.in_progress;
+  m["in_progress"] = st.in_progress;
   m["product_type"] =
       QString::fromStdString(Game::Units::troop_typeToString(st.product_type));
-  m["timeRemaining"] = st.time_remaining;
-  m["buildTime"] = st.build_time;
-  m["producedCount"] = st.produced_count;
-  m["maxUnits"] = st.max_units;
-  m["villagerCost"] = st.villager_cost;
-  m["queueSize"] = st.queue_size;
+  m["time_remaining"] = st.time_remaining;
+  m["build_time"] = st.build_time;
+  m["produced_count"] = st.produced_count;
+  m["max_units"] = st.max_units;
+  m["villager_cost"] = st.villager_cost;
+  m["queue_size"] = st.queue_size;
   m["nation_id"] =
       QString::fromStdString(Game::Systems::nationIDToString(st.nation_id));
 
@@ -982,7 +990,7 @@ auto GameEngine::get_selected_production_state() const -> QVariantMap {
     queue_list.append(
         QString::fromStdString(Game::Units::troop_typeToString(unit_type)));
   }
-  m["productionQueue"] = queue_list;
+  m["production_queue"] = queue_list;
 
   return m;
 }
@@ -991,12 +999,13 @@ auto GameEngine::get_selected_units_command_mode() const -> QString {
   if (!m_world) {
     return "normal";
   }
-  auto *selection_system = m_world->get_system<Game::Systems::SelectionSystem>();
+  auto *selection_system =
+      m_world->get_system<Game::Systems::SelectionSystem>();
   if (selection_system == nullptr) {
     return "normal";
   }
 
-  const auto &sel = selection_system->getSelectedUnits();
+  const auto &sel = selection_system->get_selected_units();
   if (sel.empty()) {
     return "normal";
   }
@@ -1052,7 +1061,7 @@ void GameEngine::set_rally_at_screen(qreal sx, qreal sy) {
   }
   m_commandController->setRallyAtScreen(sx, sy, m_viewport.width,
                                         m_viewport.height, m_camera.get(),
-                                        m_runtime.localOwnerId);
+                                        m_runtime.local_owner_id);
 }
 
 void GameEngine::start_loading_maps() {
@@ -1116,7 +1125,7 @@ void GameEngine::load_campaigns() {
 }
 
 void GameEngine::start_campaign_mission(const QString &campaign_id) {
-  clearError();
+  clear_error();
 
   if (!m_saveLoadService) {
     set_error("Save/Load service not initialized");
@@ -1197,7 +1206,7 @@ void GameEngine::mark_current_mission_completed() {
 void GameEngine::start_skirmish(const QString &map_path,
                                 const QVariantList &playerConfigs) {
 
-  clearError();
+  clear_error();
 
   m_level.map_path = map_path;
   m_level.map_name = map_path;
@@ -1262,19 +1271,20 @@ void GameEngine::start_skirmish(const QString &map_path,
       set_error(result.errorMessage);
     }
 
-    m_runtime.localOwnerId = updated_player_id;
+    m_runtime.local_owner_id = updated_player_id;
     m_level.map_name = result.map_name;
     m_level.player_unit_id = result.player_unit_id;
-    m_level.camFov = result.camFov;
-    m_level.camNear = result.camNear;
-    m_level.camFar = result.camFar;
+    m_level.cam_fov = result.cam_fov;
+    m_level.cam_near = result.cam_near;
+    m_level.cam_far = result.cam_far;
     m_level.max_troops_per_player = result.max_troops_per_player;
 
     Game::GameConfig::instance().setMaxTroopsPerPlayer(
         result.max_troops_per_player);
 
     if (m_victoryService) {
-      m_victoryService->configure(result.victoryConfig, m_runtime.localOwnerId);
+      m_victoryService->configure(result.victoryConfig,
+                                  m_runtime.local_owner_id);
       m_victoryService->setVictoryCallback([this](const QString &state) {
         if (m_runtime.victory_state != state) {
           m_runtime.victory_state = state;
@@ -1336,11 +1346,11 @@ void GameEngine::open_settings() {
 void GameEngine::load_save() { load_from_slot("savegame"); }
 
 void GameEngine::save_game(const QString &filename) {
-  saveToSlot(filename, filename);
+  save_to_slot(filename, filename);
 }
 
 void GameEngine::save_game_to_slot(const QString &slotName) {
-  saveToSlot(slotName, slotName);
+  save_to_slot(slotName, slotName);
 }
 
 void GameEngine::load_game_from_slot(const QString &slotName) {
@@ -1389,7 +1399,7 @@ auto GameEngine::load_from_slot(const QString &slot) -> bool {
 
   if (m_victoryService) {
     m_victoryService->configure(Game::Map::VictoryConfig(),
-                                m_runtime.localOwnerId);
+                                m_runtime.local_owner_id);
   }
 
   m_runtime.loading = false;
@@ -1400,7 +1410,8 @@ auto GameEngine::load_from_slot(const QString &slot) -> bool {
   return true;
 }
 
-auto GameEngine::save_to_slot(const QString &slot, const QString &title) -> bool {
+auto GameEngine::save_to_slot(const QString &slot,
+                              const QString &title) -> bool {
   if (!m_saveLoadService || !m_world) {
     set_error("Save: not initialized");
     return false;
@@ -1455,7 +1466,7 @@ void GameEngine::exit_game() {
   }
 }
 
-auto GameEngine::getOwnerInfo() const -> QVariantList {
+auto GameEngine::get_owner_info() const -> QVariantList {
   QVariantList result;
   const auto &owner_registry = Game::Systems::OwnerRegistry::instance();
   const auto &owners = owner_registry.getAllOwners();
@@ -1479,7 +1490,7 @@ auto GameEngine::getOwnerInfo() const -> QVariantList {
       break;
     }
     owner_map["type"] = type_str;
-    owner_map["isLocal"] = (owner.owner_id == m_runtime.localOwnerId);
+    owner_map["isLocal"] = (owner.owner_id == m_runtime.local_owner_id);
 
     result.append(owner_map);
   }
@@ -1493,12 +1504,12 @@ void GameEngine::get_selected_unit_ids(
   if (!m_selectionController) {
     return;
   }
-  m_selectionController->getSelectedUnitIds(out);
+  m_selectionController->get_selected_unit_ids(out);
 }
 
 auto GameEngine::get_unit_info(Engine::Core::EntityID id, QString &name,
-                             int &health, int &max_health, bool &isBuilding,
-                             bool &alive, QString &nation) const -> bool {
+                               int &health, int &max_health, bool &isBuilding,
+                               bool &alive, QString &nation) const -> bool {
   if (!m_world) {
     return false;
   }
@@ -1526,7 +1537,7 @@ auto GameEngine::get_unit_info(Engine::Core::EntityID id, QString &name,
 void GameEngine::on_unit_spawned(const Engine::Core::UnitSpawnedEvent &event) {
   auto &owners = Game::Systems::OwnerRegistry::instance();
 
-  if (event.owner_id == m_runtime.localOwnerId) {
+  if (event.owner_id == m_runtime.local_owner_id) {
     if (event.spawn_type == Game::Units::SpawnType::Barracks) {
       m_entityCache.playerBarracksAlive = true;
     } else {
@@ -1545,7 +1556,7 @@ void GameEngine::on_unit_spawned(const Engine::Core::UnitSpawnedEvent &event) {
   auto emit_if_changed = [&] {
     if (m_entityCache.playerTroopCount != m_runtime.lastTroopCount) {
       m_runtime.lastTroopCount = m_entityCache.playerTroopCount;
-      emit troop_countChanged();
+      emit troop_count_changed();
     }
   };
   emit_if_changed();
@@ -1554,7 +1565,7 @@ void GameEngine::on_unit_spawned(const Engine::Core::UnitSpawnedEvent &event) {
 void GameEngine::on_unit_died(const Engine::Core::UnitDiedEvent &event) {
   auto &owners = Game::Systems::OwnerRegistry::instance();
 
-  if (event.owner_id == m_runtime.localOwnerId) {
+  if (event.owner_id == m_runtime.local_owner_id) {
     if (event.spawn_type == Game::Units::SpawnType::Barracks) {
       m_entityCache.playerBarracksAlive = false;
     } else {
@@ -1579,7 +1590,7 @@ void GameEngine::on_unit_died(const Engine::Core::UnitDiedEvent &event) {
   auto emit_if_changed = [&] {
     if (m_entityCache.playerTroopCount != m_runtime.lastTroopCount) {
       m_runtime.lastTroopCount = m_entityCache.playerTroopCount;
-      emit troop_countChanged();
+      emit troop_count_changed();
     }
   };
   emit_if_changed();
@@ -1601,7 +1612,7 @@ void GameEngine::rebuild_entity_cache() {
       continue;
     }
 
-    if (unit->owner_id == m_runtime.localOwnerId) {
+    if (unit->owner_id == m_runtime.local_owner_id) {
       if (unit->spawn_type == Game::Units::SpawnType::Barracks) {
         m_entityCache.playerBarracksAlive = true;
       } else {
@@ -1621,7 +1632,7 @@ void GameEngine::rebuild_entity_cache() {
   auto emit_if_changed = [&] {
     if (m_entityCache.playerTroopCount != m_runtime.lastTroopCount) {
       m_runtime.lastTroopCount = m_entityCache.playerTroopCount;
-      emit troop_countChanged();
+      emit troop_count_changed();
     }
   };
   emit_if_changed();
@@ -1633,7 +1644,7 @@ void GameEngine::rebuild_registries_after_load() {
   }
 
   auto &owner_registry = Game::Systems::OwnerRegistry::instance();
-  m_runtime.localOwnerId = owner_registry.getLocalPlayerId();
+  m_runtime.local_owner_id = owner_registry.getLocalPlayerId();
 
   auto &troops = Game::Systems::TroopCountRegistry::instance();
   troops.rebuild_from_world(*m_world);
@@ -1658,14 +1669,14 @@ void GameEngine::rebuild_registries_after_load() {
     if (unit == nullptr) {
       continue;
     }
-    if (unit->owner_id == m_runtime.localOwnerId) {
+    if (unit->owner_id == m_runtime.local_owner_id) {
       m_level.player_unit_id = entity->get_id();
       break;
     }
   }
 
-  if (m_selectedPlayerId != m_runtime.localOwnerId) {
-    m_selectedPlayerId = m_runtime.localOwnerId;
+  if (m_selectedPlayerId != m_runtime.local_owner_id) {
+    m_selectedPlayerId = m_runtime.local_owner_id;
     emit selected_player_id_changed();
   }
 }
@@ -1677,7 +1688,8 @@ void GameEngine::rebuild_building_collisions() {
     return;
   }
 
-  auto buildings = m_world->get_entities_with<Engine::Core::BuildingComponent>();
+  auto buildings =
+      m_world->get_entities_with<Engine::Core::BuildingComponent>();
   for (auto *entity : buildings) {
     auto *transform = entity->get_component<Engine::Core::TransformComponent>();
     auto *unit = entity->get_component<Engine::Core::UnitComponent>();
@@ -1694,8 +1706,8 @@ void GameEngine::rebuild_building_collisions() {
 auto GameEngine::to_runtime_snapshot() const -> Game::Systems::RuntimeSnapshot {
   Game::Systems::RuntimeSnapshot snap;
   snap.paused = m_runtime.paused;
-  snap.timeScale = m_runtime.timeScale;
-  snap.localOwnerId = m_runtime.localOwnerId;
+  snap.time_scale = m_runtime.time_scale;
+  snap.local_owner_id = m_runtime.local_owner_id;
   snap.victory_state = m_runtime.victory_state;
   snap.cursor_mode = CursorModeUtils::toInt(m_runtime.cursor_mode);
   snap.selected_player_id = m_selectedPlayerId;
@@ -1705,9 +1717,9 @@ auto GameEngine::to_runtime_snapshot() const -> Game::Systems::RuntimeSnapshot {
 
 void GameEngine::apply_runtime_snapshot(
     const Game::Systems::RuntimeSnapshot &snapshot) {
-  m_runtime.localOwnerId = snapshot.localOwnerId;
+  m_runtime.local_owner_id = snapshot.local_owner_id;
   set_paused(snapshot.paused);
-  set_game_speed(snapshot.timeScale);
+  set_game_speed(snapshot.time_scale);
 
   if (snapshot.victory_state != m_runtime.victory_state) {
     m_runtime.victory_state = snapshot.victory_state;
@@ -1725,7 +1737,7 @@ void GameEngine::apply_runtime_snapshot(
     m_followSelectionEnabled = snapshot.follow_selection;
     if (m_camera && m_cameraService && m_world) {
       m_cameraService->follow_selection(*m_camera, *m_world,
-                                       m_followSelectionEnabled);
+                                        m_followSelectionEnabled);
     }
   }
 }
@@ -1757,7 +1769,8 @@ auto GameEngine::capture_screenshot() const -> QByteArray {
   return buffer;
 }
 
-void GameEngine::restore_environment_from_metadata(const QJsonObject &metadata) {
+void GameEngine::restore_environment_from_metadata(
+    const QJsonObject &metadata) {
   if (!m_world) {
     return;
   }
@@ -1792,9 +1805,9 @@ void GameEngine::restore_environment_from_metadata(const QJsonObject &metadata)
       m_level.map_name = def.name;
     }
 
-    m_level.camFov = def.camera.fovY;
-    m_level.camNear = def.camera.near_plane;
-    m_level.camFar = def.camera.far_plane;
+    m_level.cam_fov = def.camera.fovY;
+    m_level.cam_near = def.camera.near_plane;
+    m_level.cam_far = def.camera.far_plane;
   }
 
   if (m_renderer && m_camera) {
@@ -1863,7 +1876,7 @@ void GameEngine::restore_environment_from_metadata(const QJsonObject &metadata)
 
     auto &visibility_service = Game::Map::VisibilityService::instance();
     visibility_service.initialize(grid_width, grid_height, tile_size);
-    visibility_service.computeImmediate(*m_world, m_runtime.localOwnerId);
+    visibility_service.computeImmediate(*m_world, m_runtime.local_owner_id);
 
     if (m_fog && visibility_service.isInitialized()) {
       m_fog->updateMask(
@@ -1896,7 +1909,7 @@ void GameEngine::restore_environment_from_metadata(const QJsonObject &metadata)
     auto &visibility_service = Game::Map::VisibilityService::instance();
     visibility_service.initialize(fallback_grid_width, fallback_grid_height,
                                   fallback_tile_size);
-    visibility_service.computeImmediate(*m_world, m_runtime.localOwnerId);
+    visibility_service.computeImmediate(*m_world, m_runtime.local_owner_id);
     if (m_fog && visibility_service.isInitialized()) {
       m_fog->updateMask(
           visibility_service.getWidth(), visibility_service.getHeight(),
@@ -1967,7 +1980,7 @@ auto GameEngine::is_player_in_combat() const -> bool {
 
   for (auto *entity : units) {
     auto *unit = entity->get_component<Engine::Core::UnitComponent>();
-    if ((unit == nullptr) || unit->owner_id != m_runtime.localOwnerId ||
+    if ((unit == nullptr) || unit->owner_id != m_runtime.local_owner_id ||
         unit->health <= 0) {
       continue;
     }
@@ -1985,7 +1998,7 @@ auto GameEngine::is_player_in_combat() const -> bool {
       auto *other_unit =
           other_entity->get_component<Engine::Core::UnitComponent>();
       if ((other_unit == nullptr) ||
-          other_unit->owner_id == m_runtime.localOwnerId ||
+          other_unit->owner_id == m_runtime.local_owner_id ||
           other_unit->health <= 0) {
         continue;
       }

+ 26 - 21
app/core/game_engine.h

@@ -89,13 +89,16 @@ public:
                  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(QString victory_state READ victory_state NOTIFY victory_state_changed)
+  Q_PROPERTY(
+      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(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)
+      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
@@ -108,7 +111,8 @@ public:
                  available_campaigns_changed)
   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(
+      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)
@@ -118,7 +122,7 @@ public:
   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);
+                                    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);
@@ -142,11 +146,13 @@ public:
 
   Q_INVOKABLE void set_paused(bool paused) { m_runtime.paused = paused; }
   Q_INVOKABLE void set_game_speed(float speed) {
-    m_runtime.timeScale = std::max(0.0F, speed);
+    m_runtime.time_scale = std::max(0.0F, speed);
   }
   [[nodiscard]] bool paused() const { return m_runtime.paused; }
-  [[nodiscard]] float time_scale() const { return m_runtime.timeScale; }
-  [[nodiscard]] QString victory_state() const { return m_runtime.victory_state; }
+  [[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);
@@ -168,10 +174,10 @@ public:
       emit selected_player_id_changed();
     }
   }
-  [[nodiscard]] QString last_error() const { return m_runtime.lastError; }
+  [[nodiscard]] QString last_error() const { return m_runtime.last_error; }
   Q_INVOKABLE void clear_error() {
-    if (!m_runtime.lastError.isEmpty()) {
-      m_runtime.lastError = "";
+    if (!m_runtime.last_error.isEmpty()) {
+      m_runtime.last_error = "";
       emit last_error_changed();
     }
   }
@@ -211,8 +217,8 @@ public:
 
   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;
+                     int &max_health, bool &isBuilding, bool &alive,
+                     QString &nation) const;
 
   [[nodiscard]] bool has_patrol_preview_waypoint() const;
   [[nodiscard]] QVector3D get_patrol_preview_waypoint() const;
@@ -222,12 +228,12 @@ private:
     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;
@@ -335,7 +341,6 @@ signals:
   void global_cursor_changed();
   void troop_count_changed();
   void available_maps_changed();
-  void maps_loading_changed();
   void available_campaigns_changed();
   void owner_info_changed();
   void selected_player_id_changed();

+ 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;

+ 2 - 1
app/models/graphics_settings_proxy.h

@@ -10,7 +10,8 @@ class GraphicsSettingsProxy : public QObject {
   Q_OBJECT
   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(
+      QString quality_name READ quality_name NOTIFY quality_level_changed)
   Q_PROPERTY(QStringList quality_options READ quality_options CONSTANT)
 
 public:

+ 4 - 4
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;
   }

+ 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;

+ 12 - 12
app/utils/engine_view_helpers.h

@@ -8,26 +8,26 @@
 
 namespace App::Utils {
 
-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 {
+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::screen_to_ground(*camera, w, h, screenPt,
-                                                       outWorld);
+  return Game::Systems::PickingService::screen_to_ground(*camera, w, h,
+                                                         screenPt, outWorld);
 }
 
 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 {
+                            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;
@@ -35,7 +35,7 @@ inline auto world_to_screen(const Game::Systems::PickingService *pickingService,
   int const w = (viewportWidth > 0 ? viewportWidth : window->width());
   int const h = (viewportHeight > 0 ? viewportHeight : window->height());
   return Game::Systems::PickingService::world_to_screen(*camera, w, h, world,
-                                                      outScreen);
+                                                        outScreen);
 }
 
 } // namespace App::Utils

+ 4 - 4
app/utils/selection_utils.h

@@ -11,11 +11,11 @@ namespace App::Utils {
 
 inline void
 sanitize_selection(Engine::Core::World *world,
-                  Game::Systems::SelectionSystem *selection_system) {
+                   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) {
@@ -29,9 +29,9 @@ sanitize_selection(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);
     }
   }
 }

+ 2 - 2
game/audio/AudioSystem.cpp

@@ -75,8 +75,8 @@ void AudioSystem::shutdown() {
   }
 }
 
-void AudioSystem::playSound(const std::string &sound_id, 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, sound_id, volume, loop,
                      priority, category);

+ 1 - 1
game/core/component.h

@@ -135,7 +135,7 @@ public:
   EntityID melee_lock_target_id{0};
 
   [[nodiscard]] auto is_in_melee_range(float distance,
-                                    float height_diff) const -> bool {
+                                       float height_diff) const -> bool {
     return distance <= melee_range && height_diff <= max_height_difference;
   }
 

+ 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

+ 2 - 2
game/core/event_manager.h

@@ -251,8 +251,8 @@ public:
 
 class AudioTriggerEvent : public Event {
 public:
-  AudioTriggerEvent(std::string sound_id, float volume = 1.0F, bool loop = false,
-                    int priority = 0)
+  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 sound_id;

+ 97 - 94
game/core/serialization.cpp

@@ -81,27 +81,27 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
 
   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->has_desired_yaw;
-    transform_obj["desiredYaw"] = transform->desired_yaw;
+    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->get_component<RenderableComponent>()) {
     QJsonObject renderable_obj;
-    renderable_obj["meshPath"] = QString::fromStdString(renderable->mesh_path);
-    renderable_obj["texturePath"] =
+    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["rendererId"] =
+      renderable_obj["renderer_id"] =
           QString::fromStdString(renderable->renderer_id);
     }
     renderable_obj["visible"] = renderable->visible;
@@ -125,20 +125,20 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
 
   if (const auto *movement = entity->get_component<MovementComponent>()) {
     QJsonObject movement_obj;
-    movement_obj["hasTarget"] = movement->has_target;
+    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->goal_x;
-    movement_obj["goalY"] = movement->goal_y;
+    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->path_pending;
-    movement_obj["pendingRequestId"] =
+    movement_obj["path_pending"] = movement->path_pending;
+    movement_obj["pending_request_id"] =
         static_cast<qint64>(movement->pending_request_id);
-    movement_obj["repathCooldown"] = movement->repath_cooldown;
-    movement_obj["lastGoalX"] = movement->last_goal_x;
-    movement_obj["lastGoalY"] = movement->last_goal_y;
-    movement_obj["timeSinceLastPathRequest"] =
+    movement_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;
@@ -157,17 +157,17 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     attack_obj["range"] = attack->range;
     attack_obj["damage"] = attack->damage;
     attack_obj["cooldown"] = attack->cooldown;
-    attack_obj["timeSinceLast"] = attack->time_since_last;
-    attack_obj["meleeRange"] = attack->melee_range;
-    attack_obj["meleeDamage"] = attack->melee_damage;
-    attack_obj["meleeCooldown"] = attack->melee_cooldown;
-    attack_obj["preferredMode"] = combatModeToString(attack->preferred_mode);
-    attack_obj["currentMode"] = combatModeToString(attack->current_mode);
-    attack_obj["canMelee"] = attack->can_melee;
-    attack_obj["canRanged"] = attack->can_ranged;
-    attack_obj["max_heightDifference"] = attack->max_height_difference;
-    attack_obj["inMeleeLock"] = attack->in_melee_lock;
-    attack_obj["meleeLockTargetId"] =
+    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;
   }
@@ -177,13 +177,13 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
     QJsonObject attack_target_obj;
     attack_target_obj["target_id"] =
         static_cast<qint64>(attack_target->target_id);
-    attack_target_obj["shouldChase"] = attack_target->should_chase;
+    attack_target_obj["should_chase"] = attack_target->should_chase;
     entity_obj["attack_target"] = attack_target_obj;
   }
 
   if (const auto *patrol = entity->get_component<PatrolComponent>()) {
     QJsonObject patrol_obj;
-    patrol_obj["currentWaypoint"] = static_cast<int>(patrol->current_waypoint);
+    patrol_obj["current_waypoint"] = static_cast<int>(patrol->current_waypoint);
     patrol_obj["patrolling"] = patrol->patrolling;
 
     QJsonArray waypoints_array;
@@ -203,17 +203,17 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
 
   if (const auto *production = entity->get_component<ProductionComponent>()) {
     QJsonObject production_obj;
-    production_obj["inProgress"] = production->in_progress;
-    production_obj["buildTime"] = production->build_time;
-    production_obj["timeRemaining"] = production->time_remaining;
-    production_obj["producedCount"] = production->produced_count;
-    production_obj["maxUnits"] = production->max_units;
+    production_obj["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->rally_x;
-    production_obj["rallyZ"] = production->rally_z;
-    production_obj["rallySet"] = production->rally_set;
-    production_obj["villagerCost"] = production->villager_cost;
+    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->production_queue) {
@@ -231,10 +231,10 @@ auto Serialization::serializeEntity(const Entity *entity) -> QJsonObject {
   if (const auto *capture = entity->get_component<CaptureComponent>()) {
     QJsonObject capture_obj;
     capture_obj["capturing_player_id"] = capture->capturing_player_id;
-    capture_obj["captureProgress"] =
+    capture_obj["capture_progress"] =
         static_cast<double>(capture->capture_progress);
-    capture_obj["requiredTime"] = static_cast<double>(capture->required_time);
-    capture_obj["isBeingCaptured"] = capture->is_being_captured;
+    capture_obj["required_time"] = static_cast<double>(capture->required_time);
+    capture_obj["is_being_captured"] = capture->is_being_captured;
     entity_obj["capture"] = capture_obj;
   }
 
@@ -246,35 +246,37 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     const auto transform_obj = json["transform"].toObject();
     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->has_desired_yaw = transform_obj["hasDesiredYaw"].toBool(false);
+    transform->has_desired_yaw = transform_obj["has_desired_yaw"].toBool(false);
     transform->desired_yaw =
-        static_cast<float>(transform_obj["desiredYaw"].toDouble());
+        static_cast<float>(transform_obj["desired_yaw"].toDouble());
   }
 
   if (json.contains("renderable")) {
     const auto renderable_obj = json["renderable"].toObject();
     auto *renderable = entity->add_component<RenderableComponent>("", "");
-    renderable->mesh_path = renderable_obj["meshPath"].toString().toStdString();
+    renderable->mesh_path =
+        renderable_obj["mesh_path"].toString().toStdString();
     renderable->texture_path =
-        renderable_obj["texturePath"].toString().toStdString();
+        renderable_obj["texture_path"].toString().toStdString();
     renderable->renderer_id =
-        renderable_obj["rendererId"].toString().toStdString();
+        renderable_obj["renderer_id"].toString().toStdString();
     renderable->visible = renderable_obj["visible"].toBool(true);
     renderable->mesh =
         static_cast<RenderableComponent::MeshKind>(renderable_obj["mesh"].toInt(
@@ -321,26 +323,26 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
   if (json.contains("movement")) {
     const auto movement_obj = json["movement"].toObject();
     auto *movement = entity->add_component<MovementComponent>();
-    movement->has_target = movement_obj["hasTarget"].toBool(false);
+    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->goal_x = static_cast<float>(movement_obj["goalX"].toDouble());
-    movement->goal_y = 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->path_pending = movement_obj["pathPending"].toBool(false);
+    movement->path_pending = movement_obj["path_pending"].toBool(false);
     movement->pending_request_id = static_cast<std::uint64_t>(
-        movement_obj["pendingRequestId"].toVariant().toULongLong());
+        movement_obj["pending_request_id"].toVariant().toULongLong());
     movement->repath_cooldown =
-        static_cast<float>(movement_obj["repathCooldown"].toDouble());
+        static_cast<float>(movement_obj["repath_cooldown"].toDouble());
     movement->last_goal_x =
-        static_cast<float>(movement_obj["lastGoalX"].toDouble());
+        static_cast<float>(movement_obj["last_goal_x"].toDouble());
     movement->last_goal_y =
-        static_cast<float>(movement_obj["lastGoalY"].toDouble());
-    movement->time_since_last_path_request =
-        static_cast<float>(movement_obj["timeSinceLastPathRequest"].toDouble());
+        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();
@@ -360,24 +362,24 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     attack->damage = attack_obj["damage"].toInt(0);
     attack->cooldown = static_cast<float>(attack_obj["cooldown"].toDouble());
     attack->time_since_last =
-        static_cast<float>(attack_obj["timeSinceLast"].toDouble());
-    attack->melee_range = static_cast<float>(attack_obj["meleeRange"].toDouble(
+        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->melee_damage = attack_obj["meleeDamage"].toInt(0);
+    attack->melee_damage = attack_obj["melee_damage"].toInt(0);
     attack->melee_cooldown =
-        static_cast<float>(attack_obj["meleeCooldown"].toDouble());
+        static_cast<float>(attack_obj["melee_cooldown"].toDouble());
     attack->preferred_mode =
-        combatModeFromString(attack_obj["preferredMode"].toString());
+        combatModeFromString(attack_obj["preferred_mode"].toString());
     attack->current_mode =
-        combatModeFromString(attack_obj["currentMode"].toString());
-    attack->can_melee = attack_obj["canMelee"].toBool(true);
-    attack->can_ranged = attack_obj["canRanged"].toBool(false);
+        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_heightDifference"].toDouble(
+        static_cast<float>(attack_obj["max_height_difference"].toDouble(
             static_cast<double>(Defaults::kAttackHeightTolerance)));
-    attack->in_melee_lock = attack_obj["inMeleeLock"].toBool(false);
+    attack->in_melee_lock = attack_obj["in_melee_lock"].toBool(false);
     attack->melee_lock_target_id = static_cast<EntityID>(
-        attack_obj["meleeLockTargetId"].toVariant().toULongLong());
+        attack_obj["melee_lock_target_id"].toVariant().toULongLong());
   }
 
   if (json.contains("attack_target")) {
@@ -385,14 +387,15 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     auto *attack_target = entity->add_component<AttackTargetComponent>();
     attack_target->target_id = static_cast<EntityID>(
         attack_target_obj["target_id"].toVariant().toULongLong());
-    attack_target->should_chase = 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->add_component<PatrolComponent>();
-    patrol->current_waypoint =
-        static_cast<size_t>(std::max(0, patrol_obj["currentWaypoint"].toInt()));
+    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();
@@ -413,21 +416,21 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
   if (json.contains("production")) {
     const auto production_obj = json["production"].toObject();
     auto *production = entity->add_component<ProductionComponent>();
-    production->in_progress = production_obj["inProgress"].toBool(false);
+    production->in_progress = production_obj["in_progress"].toBool(false);
     production->build_time =
-        static_cast<float>(production_obj["buildTime"].toDouble());
+        static_cast<float>(production_obj["build_time"].toDouble());
     production->time_remaining =
-        static_cast<float>(production_obj["timeRemaining"].toDouble());
-    production->produced_count = production_obj["producedCount"].toInt(0);
-    production->max_units = production_obj["maxUnits"].toInt(0);
+        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->rally_x =
-        static_cast<float>(production_obj["rallyX"].toDouble());
+        static_cast<float>(production_obj["rally_x"].toDouble());
     production->rally_z =
-        static_cast<float>(production_obj["rallyZ"].toDouble());
-    production->rally_set = production_obj["rallySet"].toBool(false);
-    production->villager_cost = production_obj["villagerCost"].toInt(1);
+        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();
@@ -447,11 +450,11 @@ void Serialization::deserializeEntity(Entity *entity, const QJsonObject &json) {
     auto *capture = entity->add_component<CaptureComponent>();
     capture->capturing_player_id = capture_obj["capturing_player_id"].toInt(-1);
     capture->capture_progress =
-        static_cast<float>(capture_obj["captureProgress"].toDouble(0.0));
+        static_cast<float>(capture_obj["capture_progress"].toDouble(0.0));
     capture->required_time =
-        static_cast<float>(capture_obj["requiredTime"].toDouble(
+        static_cast<float>(capture_obj["required_time"].toDouble(
             static_cast<double>(Defaults::kCaptureRequiredTime)));
-    capture->is_being_captured = capture_obj["isBeingCaptured"].toBool(false);
+    capture->is_being_captured = capture_obj["is_being_captured"].toBool(false);
   }
 }
 

+ 12 - 11
game/core/world.cpp

@@ -15,7 +15,7 @@ namespace Engine::Core {
 World::World() = default;
 World::~World() = default;
 
-auto World::createEntity() -> Entity * {
+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);
@@ -24,7 +24,7 @@ auto World::createEntity() -> Entity * {
   return ptr;
 }
 
-auto World::createEntityWithId(EntityID entity_id) -> Entity * {
+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;
@@ -41,7 +41,7 @@ auto World::createEntityWithId(EntityID entity_id) -> Entity * {
   return ptr;
 }
 
-void World::destroyEntity(EntityID entity_id) {
+void World::destroy_entity(EntityID entity_id) {
   const std::lock_guard<std::recursive_mutex> lock(m_entity_mutex);
   m_entities.erase(entity_id);
 }
@@ -52,13 +52,13 @@ void World::clear() {
   m_next_entity_id = 1;
 }
 
-auto World::getEntity(EntityID entity_id) -> Entity * {
+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));
 }
 
@@ -68,7 +68,7 @@ void World::update(float delta_time) {
   }
 }
 
-auto World::getUnitsOwnedBy(int owner_id) const -> std::vector<Entity *> {
+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());
@@ -84,7 +84,8 @@ auto World::getUnitsOwnedBy(int owner_id) const -> std::vector<Entity *> {
   return result;
 }
 
-auto World::getUnitsNotOwnedBy(int owner_id) const -> std::vector<Entity *> {
+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());
@@ -100,7 +101,7 @@ auto World::getUnitsNotOwnedBy(int owner_id) const -> std::vector<Entity *> {
   return result;
 }
 
-auto World::getAlliedUnits(int owner_id) const -> std::vector<Entity *> {
+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());
@@ -120,7 +121,7 @@ auto World::getAlliedUnits(int owner_id) const -> std::vector<Entity *> {
   return result;
 }
 
-auto World::getEnemyUnits(int owner_id) const -> std::vector<Entity *> {
+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());
@@ -143,12 +144,12 @@ auto World::count_troops_for_player(int owner_id) -> int {
   return Game::Systems::TroopCountRegistry::instance().getTroopCount(owner_id);
 }
 
-auto World::getNextEntityId() const -> EntityID {
+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) {
+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);
 }

+ 6 - 6
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;
@@ -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;

+ 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;
 };
 

+ 5 - 5
game/map/skirmish_loader.cpp

@@ -66,7 +66,7 @@ SkirmishLoader::SkirmishLoader(Engine::Core::World &world,
 void SkirmishLoader::resetGameState() {
   if (auto *selection_system =
           m_world.get_system<Game::Systems::SelectionSystem>()) {
-    selection_system->clearSelection();
+    selection_system->clear_selection();
   }
 
   m_renderer.pause();
@@ -474,7 +474,7 @@ auto SkirmishLoader::start(const QString &map_path,
     }
   }
 
-  if ((focus_entity == nullptr) && level_result.player_unit_id != 0) {
+  if ((focus_entity == nullptr) && level_result.player_unit_id != 0U) {
     focus_entity = m_world.get_entity(level_result.player_unit_id);
   }
 
@@ -490,9 +490,9 @@ auto SkirmishLoader::start(const QString &map_path,
   result.ok = true;
   result.map_name = level_result.map_name;
   result.player_unit_id = level_result.player_unit_id;
-  result.camFov = level_result.camFov;
-  result.camNear = level_result.camNear;
-  result.camFar = level_result.camFar;
+  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;

+ 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

+ 14 - 14
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;

+ 1 - 1
game/systems/arrow_system.cpp

@@ -20,7 +20,7 @@ void ArrowSystem::spawnArrow(const QVector3D &start, const QVector3D &end,
   QVector3D const delta = end - start;
   float const dist = delta.length();
   a.arc_height = std::clamp(m_config.arcHeightMultiplier * dist,
-                           m_config.arcHeightMin, m_config.arcHeightMax);
+                            m_config.arcHeightMin, m_config.arcHeightMax);
 
   a.inv_dist = (dist > 0.001F) ? (1.0F / dist) : 1.0F;
   m_arrows.push_back(a);

+ 2 - 2
game/systems/camera_follow_system.cpp

@@ -10,7 +10,7 @@ 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;
   }
@@ -34,7 +34,7 @@ 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;
   }

+ 10 - 10
game/systems/camera_service.cpp

@@ -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,8 +62,8 @@ 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) {
@@ -84,7 +84,7 @@ void CameraService::setFollowLerp(Render::GL::Camera &camera, float alpha) {
 
 void CameraService::resetCamera(Render::GL::Camera &camera,
                                 Engine::Core::World &world, int local_owner_id,
-                                unsigned int playerUnitId) {
+                                unsigned int player_unit_id) {
   Engine::Core::Entity *focus_entity = nullptr;
   for (auto *e : world.get_entities_with<Engine::Core::UnitComponent>()) {
     if (e == nullptr) {
@@ -100,8 +100,8 @@ void CameraService::resetCamera(Render::GL::Camera &camera,
       break;
     }
   }
-  if ((focus_entity == nullptr) && playerUnitId != 0) {
-    focus_entity = world.get_entity(playerUnitId);
+  if ((focus_entity == nullptr) && player_unit_id != 0U) {
+    focus_entity = world.get_entity(player_unit_id);
   }
 
   if (focus_entity != nullptr) {
@@ -119,9 +119,9 @@ void CameraService::snapToEntity(Render::GL::Camera &camera,
   }
 }
 
-void CameraService::updateFollow(Render::GL::Camera &camera,
-                                 Engine::Core::World &world,
-                                 bool follow_enabled) {
+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);

+ 6 - 6
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
   get_distance(const Render::GL::Camera &camera) -> float;
   static void resetCamera(Render::GL::Camera &camera,
                           Engine::Core::World &world, int local_owner_id,
-                          unsigned int playerUnitId);
+                          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 follow_enabled);
+  void update_follow(Render::GL::Camera &camera, Engine::Core::World &world,
+                     bool follow_enabled);
 
 private:
   std::unique_ptr<CameraController> m_controller;

+ 4 - 2
game/systems/capture_system.cpp

@@ -62,7 +62,8 @@ void CaptureSystem::transferBarrackOwnership(Engine::Core::World *,
                                              Engine::Core::Entity *barrack,
                                              int new_owner_id) {
   auto *unit = barrack->get_component<Engine::Core::UnitComponent>();
-  auto *renderable = barrack->get_component<Engine::Core::RenderableComponent>();
+  auto *renderable =
+      barrack->get_component<Engine::Core::RenderableComponent>();
   auto *transform = barrack->get_component<Engine::Core::TransformComponent>();
   auto *prod = barrack->get_component<Engine::Core::ProductionComponent>();
 
@@ -131,7 +132,8 @@ void CaptureSystem::processBarrackCapture(Engine::Core::World *world,
 
   for (auto *barrack : barracks) {
     auto *unit = barrack->get_component<Engine::Core::UnitComponent>();
-    auto *transform = barrack->get_component<Engine::Core::TransformComponent>();
+    auto *transform =
+        barrack->get_component<Engine::Core::TransformComponent>();
 
     if ((unit == nullptr) || (transform == nullptr)) {
       continue;

+ 28 - 15
game/systems/combat_system.cpp

@@ -24,7 +24,8 @@ void CombatSystem::update(Engine::Core::World *world, float delta_time) {
   processAutoEngagement(world, delta_time);
 }
 
-void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time) {
+void CombatSystem::processAttacks(Engine::Core::World *world,
+                                  float delta_time) {
   auto units = world->get_entities_with<Engine::Core::UnitComponent>();
 
   auto *arrow_sys = world->get_system<ArrowSystem>();
@@ -35,7 +36,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
       continue;
     }
 
-    auto *attacker_unit = attacker->get_component<Engine::Core::UnitComponent>();
+    auto *attacker_unit =
+        attacker->get_component<Engine::Core::UnitComponent>();
     auto *attacker_transform =
         attacker->get_component<Engine::Core::TransformComponent>();
     auto *attacker_atk =
@@ -96,7 +98,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
         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->has_component<Engine::Core::PendingRemovalComponent>()) {
+          !lock_target
+               ->has_component<Engine::Core::PendingRemovalComponent>()) {
 
         auto *attack_target =
             attacker->get_component<Engine::Core::AttackTargetComponent>();
@@ -159,7 +162,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
       auto *target = world->get_entity(attack_target->target_id);
       if ((target != nullptr) &&
           !target->has_component<Engine::Core::PendingRemovalComponent>()) {
-        auto *target_unit = target->get_component<Engine::Core::UnitComponent>();
+        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,
@@ -228,7 +232,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
               is_ranged_unit = true;
             }
 
-            bool const currently_in_range = is_in_range(attacker, target, range);
+            bool const currently_in_range =
+                is_in_range(attacker, target, range);
 
             if (is_ranged_unit && currently_in_range) {
               auto *movement =
@@ -302,7 +307,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
                     attacker->get_component<Engine::Core::MovementComponent>();
                 if (movement == nullptr) {
                   movement =
-                      attacker->add_component<Engine::Core::MovementComponent>();
+                      attacker
+                          ->add_component<Engine::Core::MovementComponent>();
                 }
 
                 if (movement != nullptr) {
@@ -379,7 +385,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
           continue;
         }
 
-        auto *target_unit = target->get_component<Engine::Core::UnitComponent>();
+        auto *target_unit =
+            target->get_component<Engine::Core::UnitComponent>();
         if ((target_unit == nullptr) || target_unit->health <= 0) {
           continue;
         }
@@ -449,7 +456,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
       if (auto *att_t =
               attacker->get_component<Engine::Core::TransformComponent>()) {
         if (auto *tgt_t =
-                best_target->get_component<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 =
@@ -573,8 +581,8 @@ void CombatSystem::processAttacks(Engine::Core::World *world, float delta_time)
 }
 
 auto CombatSystem::is_in_range(Engine::Core::Entity *attacker,
-                             Engine::Core::Entity *target,
-                             float range) -> bool {
+                               Engine::Core::Entity *target,
+                               float range) -> bool {
   auto *attacker_transform =
       attacker->get_component<Engine::Core::TransformComponent>();
   auto *target_transform =
@@ -665,7 +673,8 @@ void CombatSystem::dealDamage(Engine::Core::World *world,
           target_atk->melee_lock_target_id != 0) {
 
         if (world != nullptr) {
-          auto *lock_partner = world->get_entity(target_atk->melee_lock_target_id);
+          auto *lock_partner =
+              world->get_entity(target_atk->melee_lock_target_id);
           if ((lock_partner != nullptr) &&
               !lock_partner
                    ->has_component<Engine::Core::PendingRemovalComponent>()) {
@@ -685,7 +694,8 @@ void CombatSystem::dealDamage(Engine::Core::World *world,
             target->get_id());
       }
 
-      if (auto *r = target->get_component<Engine::Core::RenderableComponent>()) {
+      if (auto *r =
+              target->get_component<Engine::Core::RenderableComponent>()) {
         r->visible = false;
       }
 
@@ -786,7 +796,8 @@ void CombatSystem::updateCombatMode(
   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;
+    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;
@@ -794,7 +805,8 @@ void CombatSystem::updateCombatMode(
     attack_comp->current_mode =
         Engine::Core::AttackComponent::CombatMode::Ranged;
   } else {
-    attack_comp->current_mode = Engine::Core::AttackComponent::CombatMode::Melee;
+    attack_comp->current_mode =
+        Engine::Core::AttackComponent::CombatMode::Melee;
   }
 }
 
@@ -899,7 +911,8 @@ auto CombatSystem::findNearestEnemy(Engine::Core::Entity *unit,
                                     Engine::Core::World *world,
                                     float max_range) -> Engine::Core::Entity * {
   auto *unit_comp = unit->get_component<Engine::Core::UnitComponent>();
-  auto *unit_transform = unit->get_component<Engine::Core::TransformComponent>();
+  auto *unit_transform =
+      unit->get_component<Engine::Core::TransformComponent>();
   if ((unit_comp == nullptr) || (unit_transform == nullptr)) {
     return nullptr;
   }

+ 1 - 1
game/systems/combat_system.h

@@ -20,7 +20,7 @@ private:
                                Engine::Core::World *world,
                                Engine::Core::AttackComponent *attack_comp);
   static auto is_in_range(Engine::Core::Entity *attacker,
-                        Engine::Core::Entity *target, float range) -> bool;
+                          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);

+ 2 - 1
game/systems/formation_system.cpp

@@ -105,7 +105,8 @@ auto FormationSystem::getFormationPositions(
   auto it = m_formations.find(type);
   if (it == m_formations.end()) {
     qWarning() << "Formation type not found, using default spread";
-    return RomanFormation().calculatePositions(unit_count, center, base_spacing);
+    return RomanFormation().calculatePositions(unit_count, center,
+                                               base_spacing);
   }
 
   return it->second->calculatePositions(unit_count, center, base_spacing);

+ 5 - 4
game/systems/game_state_serializer.cpp

@@ -20,7 +20,7 @@ auto GameStateSerializer::buildMetadata(
   metadata["map_name"] = level.map_name;
   metadata["max_troops_per_player"] = level.max_troops_per_player;
   metadata["local_owner_id"] = runtime.local_owner_id;
-  metadata["playerUnitId"] = static_cast<qint64>(level.player_unit_id);
+  metadata["player_unit_id"] = static_cast<qint64>(level.player_unit_id);
 
   metadata["gameMaxTroopsPerPlayer"] =
       Game::GameConfig::instance().getMaxTroopsPerPlayer();
@@ -36,7 +36,8 @@ auto GameStateSerializer::buildMetadata(
     QJsonObject camera_obj;
     camera_obj["position"] =
         App::JsonUtils::vec3ToJsonArray(camera->get_position());
-    camera_obj["target"] = App::JsonUtils::vec3ToJsonArray(camera->get_target());
+    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();
@@ -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")) {
+  if (metadata.contains("player_unit_id")) {
     level.player_unit_id = static_cast<Engine::Core::EntityID>(
-        metadata.value("playerUnitId").toVariant().toULongLong());
+        metadata.value("player_unit_id").toVariant().toULongLong());
   }
 
   int max_troops = metadata.value("max_troops_per_player")

+ 2 - 1
game/systems/game_state_serializer.h

@@ -45,7 +45,8 @@ public:
 
   static void restoreCameraFromMetadata(const QJsonObject &metadata,
                                         Render::GL::Camera *camera,
-                                        int viewport_width, int viewport_height);
+                                        int viewport_width,
+                                        int viewport_height);
 
   static void restoreRuntimeFromMetadata(const QJsonObject &metadata,
                                          RuntimeSnapshot &runtime);

+ 2 - 1
game/systems/global_stats_registry.cpp

@@ -86,7 +86,8 @@ void GlobalStatsRegistry::on_unit_spawned(
   }
 }
 
-void GlobalStatsRegistry::on_unit_died(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_player_stats.find(event.owner_id);

+ 4 - 0
game/systems/global_stats_registry.h

@@ -29,6 +29,10 @@ 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 mark_game_start(int owner_id);
 

+ 1 - 1
game/systems/movement_system.cpp

@@ -96,7 +96,7 @@ void MovementSystem::update(Engine::Core::World *world, float delta_time) {
 }
 
 void MovementSystem::move_unit(Engine::Core::Entity *entity,
-                              Engine::Core::World *world, float delta_time) {
+                               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>();

+ 3 - 3
game/systems/movement_system.h

@@ -15,11 +15,11 @@ public:
   void update(Engine::Core::World *world, float delta_time) override;
 
 private:
-  static void move_unit(Engine::Core::Entity *entity, Engine::Core::World *world,
-                       float delta_time);
+  static void move_unit(Engine::Core::Entity *entity,
+                        Engine::Core::World *world, float delta_time);
   static auto
   has_reached_target(const Engine::Core::TransformComponent *transform,
-                   const Engine::Core::MovementComponent *movement) -> bool;
+                     const Engine::Core::MovementComponent *movement) -> bool;
 };
 
 } // namespace Game::Systems

+ 1 - 1
game/systems/nation_loader.cpp

@@ -140,7 +140,7 @@ static auto nation_loader_logger() -> QLoggingCategory & { return logger(); }
                   QString::fromStdString(base_class.display_name))
           .toStdString();
   entry.is_melee = read_bool(ensure_object(obj.value("production")), "is_melee",
-                            base_class.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.build_time =

+ 7 - 7
game/systems/nation_registry.cpp

@@ -14,9 +14,9 @@
 
 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) {
+  for (const auto &troop : available_troops) {
     if (troop.is_melee) {
       result.push_back(&troop);
     }
@@ -24,9 +24,9 @@ auto Nation::getMeleeTroops() const -> std::vector<const TroopType *> {
   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) {
+  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;
   }

+ 2 - 1
game/systems/nation_registry.h

@@ -56,7 +56,8 @@ struct Nation {
 
   [[nodiscard]] auto get_melee_troops() const -> std::vector<const TroopType *>;
 
-  [[nodiscard]] auto get_ranged_troops() 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 *;

+ 4 - 3
game/systems/pathfinding.cpp

@@ -369,8 +369,8 @@ auto Pathfinding::collect_neighbors(
 }
 
 void Pathfinding::build_path(int start_index, int end_index,
-                            std::uint32_t generation, int expected_length,
-                            std::vector<Point> &out_path) const {
+                             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));
@@ -400,7 +400,8 @@ void Pathfinding::build_path(int start_index, int end_index,
   out_path.clear();
 }
 
-auto Pathfinding::heap_less(const QueueNode &lhs, const QueueNode &rhs) -> bool {
+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;
   }

+ 2 - 2
game/systems/pathfinding.h

@@ -84,9 +84,9 @@ private:
   void setParent(int index, std::uint32_t generation, int parentIndex);
 
   auto collect_neighbors(const Point &point,
-                        std::array<Point, 8> &buffer) const -> std::size_t;
+                         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;
+                  int expected_length, std::vector<Point> &out_path) const;
 
   struct QueueNode {
     int index;

+ 20 - 18
game/systems/picking_service.cpp

@@ -12,24 +12,25 @@
 namespace Game::Systems {
 
 auto PickingService::world_to_screen(const Render::GL::Camera &cam, int view_w,
-                                   int view_h, const QVector3D &world,
-                                   QPointF &out) -> bool {
+                                     int view_h, const QVector3D &world,
+                                     QPointF &out) -> bool {
   return cam.world_to_screen(world, qreal(view_w), qreal(view_h), out);
 }
 
 auto PickingService::screen_to_ground(const Render::GL::Camera &cam, int view_w,
-                                    int view_h, const QPointF &screen_pt,
-                                    QVector3D &out_world) -> bool {
+                                      int view_h, const QPointF &screen_pt,
+                                      QVector3D &out_world) -> bool {
   if (view_w <= 0 || view_h <= 0) {
     return false;
   }
   return cam.screen_to_ground(screen_pt.x(), screen_pt.y(), qreal(view_w),
-                            qreal(view_h), out_world);
+                              qreal(view_h), out_world);
 }
 
-auto PickingService::projectBounds(const Render::GL::Camera &cam,
-                                   const QVector3D &center, float hx, float hz,
-                                   int view_w, int view_h, 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),
@@ -55,9 +56,10 @@ auto PickingService::projectBounds(const Render::GL::Camera &cam,
   return true;
 }
 
-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 {
+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;
@@ -213,13 +215,13 @@ auto PickingService::pick_single(
   return 0;
 }
 
-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 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 = pick_single(sx, sy, world, camera, view_w, view_h, owner_filter, false);
+  auto id =
+      pick_single(sx, sy, world, camera, view_w, view_h, owner_filter, false);
   if (id != 0) {
     return id;
   }
@@ -227,7 +229,7 @@ auto PickingService::pick_unit_first(float sx, float sy,
   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 view_w, int view_h,
     int owner_filter) -> std::vector<Engine::Core::EntityID> {

+ 23 - 21
game/systems/picking_service.h

@@ -22,42 +22,44 @@ public:
   PickingService() = default;
 
   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;
+                    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;
+                               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 {
+                               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 world_to_screen(const Render::GL::Camera &camera, int view_w,
-                            int view_h, const QVector3D &world,
-                            QPointF &out_screen) -> bool;
+                              int view_h, const QVector3D &world,
+                              QPointF &out_screen) -> bool;
 
-  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
+  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 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;
+                              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 view_w, int view_h,
-             int owner_filter) -> 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 view_w, int view_h, 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

+ 41 - 37
game/systems/selection_system.cpp

@@ -20,7 +20,8 @@ namespace Game::Systems {
 void SelectionSystem::update(Engine::Core::World *world, float delta_time) {}
 
 void SelectionSystem::select_unit(Engine::Core::EntityID unit_id) {
-  auto it = std::find(m_selected_units.begin(), m_selected_units.end(), 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(
@@ -29,7 +30,8 @@ void SelectionSystem::select_unit(Engine::Core::EntityID unit_id) {
 }
 
 void SelectionSystem::deselect_unit(Engine::Core::EntityID unit_id) {
-  auto it = std::find(m_selected_units.begin(), m_selected_units.end(), 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);
   }
@@ -37,11 +39,11 @@ void SelectionSystem::deselect_unit(Engine::Core::EntityID unit_id) {
 
 void SelectionSystem::clear_selection() { m_selected_units.clear(); }
 
-void SelectionSystem::select_unitsInArea(float x1, float y1, float x2,
-                                        float y2) {}
+void SelectionSystem::select_units_in_area(float x1, float y1, float x2,
+                                           float y2) {}
 
 auto SelectionSystem::is_unit_in_area(Engine::Core::Entity *entity, float x1,
-                                   float y1, float x2, float y2) -> bool {
+                                      float y1, float x2, float y2) -> bool {
   auto *transform = entity->get_component<Engine::Core::TransformComponent>();
   if (transform == nullptr) {
     return false;
@@ -62,8 +64,9 @@ SelectionController::SelectionController(Engine::Core::World *world,
       m_picking_service(pickingService) {}
 
 void SelectionController::on_click_select(qreal sx, qreal sy, bool additive,
-                                        int viewport_width, int viewport_height,
-                                        void *camera, int local_owner_id) {
+                                          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;
@@ -71,49 +74,50 @@ void SelectionController::on_click_select(qreal sx, qreal sy, bool additive,
 
   auto *cam = static_cast<Render::GL::Camera *>(camera);
   Engine::Core::EntityID const picked =
-      Game::Systems::PickingService::pickSingle(
+      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();
+    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();
+  if (!additive && !m_selection_system->get_selected_units().empty()) {
+    m_selection_system->clear_selection();
+    sync_selection_flags();
     emit selection_changed();
   }
 }
 
-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) {
+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, viewport_width,
-      viewport_height, local_owner_id);
+  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();
+  sync_selection_flags();
   emit selection_changed();
 }
 
@@ -121,8 +125,8 @@ void SelectionController::on_right_click_clear_selection() {
   if (m_selection_system == nullptr) {
     return;
   }
-  m_selection_system->clearSelection();
-  syncSelectionFlags();
+  m_selection_system->clear_selection();
+  sync_selection_flags();
   emit selection_changed();
 }
 
@@ -131,7 +135,7 @@ void SelectionController::select_all_player_troops(int local_owner_id) {
     return;
   }
 
-  m_selection_system->clearSelection();
+  m_selection_system->clear_selection();
 
   auto entities = m_world->get_entities_with<Engine::Core::UnitComponent>();
   for (auto *e : entities) {
@@ -148,15 +152,15 @@ void SelectionController::select_all_player_troops(int local_owner_id) {
       continue;
     }
 
-    m_selection_system->selectUnit(e->get_id());
+    m_selection_system->select_unit(e->get_id());
   }
 
-  syncSelectionFlags();
+  sync_selection_flags();
   emit selection_changed();
 }
 
 void SelectionController::select_single_unit(Engine::Core::EntityID id,
-                                           int local_owner_id) {
+                                             int local_owner_id) {
   if ((m_selection_system == nullptr) || (m_world == nullptr)) {
     return;
   }
@@ -172,9 +176,9 @@ void SelectionController::select_single_unit(Engine::Core::EntityID id,
     return;
   }
 
-  m_selection_system->clearSelection();
-  m_selection_system->selectUnit(id);
-  syncSelectionFlags();
+  m_selection_system->clear_selection();
+  m_selection_system->select_unit(id);
+  sync_selection_flags();
   emit selection_changed();
 }
 
@@ -182,7 +186,7 @@ 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();
 }
 
@@ -192,7 +196,7 @@ void SelectionController::get_selected_unit_ids(
   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());
 }
 
@@ -200,7 +204,7 @@ 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->get_entity(id)) {
       if (auto *u = e->get_component<Engine::Core::UnitComponent>()) {
@@ -218,7 +222,7 @@ 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

+ 4 - 4
game/systems/selection_system.h

@@ -32,7 +32,7 @@ public:
 private:
   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;
+                              float x2, float y2) -> bool;
 };
 
 class SelectionController : public QObject {
@@ -44,10 +44,10 @@ public:
                       QObject *parent = nullptr);
 
   void on_click_select(qreal sx, qreal sy, bool additive, int viewport_width,
-                     int viewport_height, void *camera, int local_owner_id);
+                       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);
+                        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);

+ 2 - 1
game/systems/troop_count_registry.cpp

@@ -46,7 +46,8 @@ void TroopCountRegistry::on_unit_spawned(
   m_troop_counts[event.owner_id] += individuals_per_unit;
 }
 
-void TroopCountRegistry::on_unit_died(const Engine::Core::UnitDiedEvent &event) {
+void TroopCountRegistry::on_unit_died(
+    const Engine::Core::UnitDiedEvent &event) {
   if (event.spawn_type == Game::Units::SpawnType::Barracks) {
     return;
   }

+ 6 - 5
game/units/archer.cpp

@@ -90,12 +90,13 @@ void Archer::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Auto
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Auto
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
   m_atk->max_height_difference = 2.0F;

+ 6 - 5
game/units/ballista.cpp

@@ -90,12 +90,13 @@ void Ballista::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Ranged
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Ranged
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
 }

+ 6 - 5
game/units/catapult.cpp

@@ -90,12 +90,13 @@ void Catapult::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Ranged
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Ranged
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
   m_atk->max_height_difference = 5.0F;

+ 6 - 5
game/units/horse_archer.cpp

@@ -91,12 +91,13 @@ void HorseArcher::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Auto
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Auto
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
   m_atk->max_height_difference = 2.0F;

+ 6 - 5
game/units/horse_spearman.cpp

@@ -92,12 +92,13 @@ void HorseSpearman::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Auto
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Auto
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
   m_atk->max_height_difference = 2.0F;

+ 6 - 5
game/units/horse_swordsman.cpp

@@ -92,12 +92,13 @@ void MountedKnight::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Auto
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Auto
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
   m_atk->max_height_difference = 2.0F;

+ 6 - 5
game/units/spearman.cpp

@@ -91,12 +91,13 @@ void Spearman::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Auto
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Auto
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
   m_atk->max_height_difference = 2.0F;

+ 6 - 5
game/units/swordsman.cpp

@@ -91,12 +91,13 @@ void Swordsman::init(const SpawnParams &params) {
   m_atk->melee_damage = profile.combat.melee_damage;
   m_atk->melee_cooldown = profile.combat.melee_cooldown;
 
-  m_atk->preferred_mode = profile.combat.can_ranged
-                             ? Engine::Core::AttackComponent::CombatMode::Auto
-                             : Engine::Core::AttackComponent::CombatMode::Melee;
+  m_atk->preferred_mode =
+      profile.combat.can_ranged
+          ? Engine::Core::AttackComponent::CombatMode::Auto
+          : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->current_mode = profile.combat.can_ranged
-                           ? Engine::Core::AttackComponent::CombatMode::Ranged
-                           : Engine::Core::AttackComponent::CombatMode::Melee;
+                            ? Engine::Core::AttackComponent::CombatMode::Ranged
+                            : Engine::Core::AttackComponent::CombatMode::Melee;
   m_atk->can_ranged = profile.combat.can_ranged;
   m_atk->can_melee = profile.combat.can_melee;
   m_atk->max_height_difference = 2.0F;

+ 2 - 2
game/units/unit.cpp

@@ -107,7 +107,7 @@ void Unit::setHoldMode(bool enabled) {
       hold_comp = e->add_component<Engine::Core::HoldModeComponent>();
     }
     hold_comp->active = true;
-    hold_comp->exitCooldown = 0.0F;
+    hold_comp->exit_cooldown = 0.0F;
 
     auto *mv = e->get_component<Engine::Core::MovementComponent>();
     if (mv != nullptr) {
@@ -118,7 +118,7 @@ void Unit::setHoldMode(bool enabled) {
   } else {
     if (hold_comp != nullptr) {
       hold_comp->active = false;
-      hold_comp->exitCooldown = hold_comp->standUpDuration;
+      hold_comp->exit_cooldown = hold_comp->stand_up_duration;
     }
   }
 }

+ 1 - 1
render/entity/mounted_humanoid_renderer_base.cpp

@@ -133,7 +133,7 @@ void MountedHumanoidRendererBase::addAttachments(
     QVector3D const horse_world_pos =
         ctx.model.map(QVector3D(0.0F, 0.0F, 0.0F));
     float const distance =
-        (horse_world_pos - ctx.camera->getPosition()).length();
+        (horse_world_pos - ctx.camera->get_position()).length();
     horse_lod = calculateHorseLOD(distance);
   }
 

+ 2 - 1
render/entity/nations/carthage/ballista_renderer.cpp

@@ -269,7 +269,8 @@ void register_ballista_renderer(EntityRendererRegistry &registry) {
         QVector3D team_color{0.4F, 0.2F, 0.6F};
         if (p.entity != nullptr) {
           if (auto *r =
-                  p.entity->get_component<Engine::Core::RenderableComponent>()) {
+                  p.entity
+                      ->get_component<Engine::Core::RenderableComponent>()) {
             team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
           }
         }

+ 2 - 1
render/entity/nations/carthage/catapult_renderer.cpp

@@ -235,7 +235,8 @@ void register_catapult_renderer(EntityRendererRegistry &registry) {
         QVector3D team_color{0.4F, 0.2F, 0.6F};
         if (p.entity != nullptr) {
           if (auto *r =
-                  p.entity->get_component<Engine::Core::RenderableComponent>()) {
+                  p.entity
+                      ->get_component<Engine::Core::RenderableComponent>()) {
             team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
           }
         }

+ 40 - 40
render/entity/nations/roman/ballista_renderer.cpp

@@ -231,46 +231,46 @@ void drawRomanOrnaments(const DrawContext &p, ISubmitter &out, Mesh *unit,
 } // namespace
 
 void register_ballista_renderer(EntityRendererRegistry &registry) {
-  registry.register_renderer(
-      "troops/roman/ballista", [](const DrawContext &p, ISubmitter &out) {
-        Mesh *unit = getUnitCube();
-        Texture *white = nullptr;
-
-        if (p.resources != nullptr) {
-          unit = p.resources->unit();
-          white = p.resources->white();
-        }
-        if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
-          unit = scene_renderer->getMeshCube();
-          white = scene_renderer->getWhiteTexture();
-        }
-
-        if (unit == nullptr || white == nullptr) {
-          return;
-        }
-
-        QVector3D team_color{0.8F, 0.2F, 0.2F};
-        if (p.entity != nullptr) {
-          if (auto *r =
-                  p.entity->get_component<Engine::Core::RenderableComponent>()) {
-            team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
-          }
-        }
-        RomanBallistaPalette c = make_palette(team_color);
-
-        DrawContext ctx = p;
-        ctx.model = p.model;
-        ctx.model.rotate(180.0F, 0.0F, 1.0F, 0.0F);
-
-        drawBaseFrame(ctx, out, unit, white, c);
-        drawWheels(ctx, out, unit, white, c);
-        drawTorsionBundles(ctx, out, unit, white, c);
-        drawArms(ctx, out, unit, white, c);
-        drawBowstring(ctx, out, white, c);
-        drawSlide(ctx, out, unit, white, c);
-        drawTriggerMechanism(ctx, out, unit, white, c);
-        drawRomanOrnaments(ctx, out, unit, white, c);
-      });
+  registry.register_renderer("troops/roman/ballista", [](const DrawContext &p,
+                                                         ISubmitter &out) {
+    Mesh *unit = getUnitCube();
+    Texture *white = nullptr;
+
+    if (p.resources != nullptr) {
+      unit = p.resources->unit();
+      white = p.resources->white();
+    }
+    if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
+      unit = scene_renderer->getMeshCube();
+      white = scene_renderer->getWhiteTexture();
+    }
+
+    if (unit == nullptr || white == nullptr) {
+      return;
+    }
+
+    QVector3D team_color{0.8F, 0.2F, 0.2F};
+    if (p.entity != nullptr) {
+      if (auto *r =
+              p.entity->get_component<Engine::Core::RenderableComponent>()) {
+        team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
+      }
+    }
+    RomanBallistaPalette c = make_palette(team_color);
+
+    DrawContext ctx = p;
+    ctx.model = p.model;
+    ctx.model.rotate(180.0F, 0.0F, 1.0F, 0.0F);
+
+    drawBaseFrame(ctx, out, unit, white, c);
+    drawWheels(ctx, out, unit, white, c);
+    drawTorsionBundles(ctx, out, unit, white, c);
+    drawArms(ctx, out, unit, white, c);
+    drawBowstring(ctx, out, white, c);
+    drawSlide(ctx, out, unit, white, c);
+    drawTriggerMechanism(ctx, out, unit, white, c);
+    drawRomanOrnaments(ctx, out, unit, white, c);
+  });
 }
 
 } // namespace Render::GL::Roman

+ 31 - 31
render/entity/nations/roman/catapult_renderer.cpp

@@ -203,37 +203,37 @@ void drawWindlass(const DrawContext &p, ISubmitter &out, Mesh *unit,
 } // namespace
 
 void register_catapult_renderer(EntityRendererRegistry &registry) {
-  registry.register_renderer(
-      "troops/roman/catapult", [](const DrawContext &p, ISubmitter &out) {
-        Mesh *unit_cube = getUnitCube();
-        Texture *white_tex = nullptr;
-
-        if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
-          unit_cube = scene_renderer->getMeshCube();
-          white_tex = scene_renderer->getWhiteTexture();
-        }
-
-        if (unit_cube == nullptr || white_tex == nullptr) {
-          return;
-        }
-
-        QVector3D team_color{0.8F, 0.2F, 0.2F};
-        if (p.entity != nullptr) {
-          if (auto *r =
-                  p.entity->get_component<Engine::Core::RenderableComponent>()) {
-            team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
-          }
-        }
-
-        auto palette = make_palette(team_color);
-
-        drawBaseFrame(p, out, unit_cube, white_tex, palette);
-        drawWheels(p, out, unit_cube, white_tex, palette);
-        drawTorsionMechanism(p, out, unit_cube, white_tex, palette);
-        drawThrowingArm(p, out, unit_cube, white_tex, palette, p.animationTime);
-        drawWindlass(p, out, unit_cube, white_tex, palette);
-        drawDecorations(p, out, unit_cube, white_tex, palette);
-      });
+  registry.register_renderer("troops/roman/catapult", [](const DrawContext &p,
+                                                         ISubmitter &out) {
+    Mesh *unit_cube = getUnitCube();
+    Texture *white_tex = nullptr;
+
+    if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
+      unit_cube = scene_renderer->getMeshCube();
+      white_tex = scene_renderer->getWhiteTexture();
+    }
+
+    if (unit_cube == nullptr || white_tex == nullptr) {
+      return;
+    }
+
+    QVector3D team_color{0.8F, 0.2F, 0.2F};
+    if (p.entity != nullptr) {
+      if (auto *r =
+              p.entity->get_component<Engine::Core::RenderableComponent>()) {
+        team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
+      }
+    }
+
+    auto palette = make_palette(team_color);
+
+    drawBaseFrame(p, out, unit_cube, white_tex, palette);
+    drawWheels(p, out, unit_cube, white_tex, palette);
+    drawTorsionMechanism(p, out, unit_cube, white_tex, palette);
+    drawThrowingArm(p, out, unit_cube, white_tex, palette, p.animationTime);
+    drawWindlass(p, out, unit_cube, white_tex, palette);
+    drawDecorations(p, out, unit_cube, white_tex, palette);
+  });
 }
 
 } // namespace Render::GL::Roman

+ 1 - 1
render/entity/registry.h

@@ -45,7 +45,7 @@ struct DrawContext {
   bool selected = false;
   bool hovered = false;
   float animationTime = 0.0F;
-  std::string rendererId;
+  std::string renderer_id;
   class Backend *backend = nullptr;
   const Camera *camera = nullptr;
 };

+ 2 - 2
render/geom/arrow.cpp

@@ -110,7 +110,7 @@ void renderArrows(Renderer *renderer, ResourceManager *resources,
     const QVector3D delta = arrow.end - arrow.start;
     const float dist = std::max(0.001F, delta.length());
     QVector3D pos = arrow.start + delta * arrow.t;
-    float const h = arrow.arcHeight * 4.0F * arrow.t * (1.0F - arrow.t);
+    float const h = arrow.arc_height * 4.0F * arrow.t * (1.0F - arrow.t);
     pos.setY(pos.y() + h);
 
     QMatrix4x4 model;
@@ -125,7 +125,7 @@ void renderArrows(Renderer *renderer, ResourceManager *resources,
     constexpr float k_arc_center_offset = 0.5F;
     float const vy = (arrow.end.y() - arrow.start.y()) / dist;
     float const pitch_deg =
-        -std::atan2(vy - (k_arc_height_multiplier * arrow.arcHeight *
+        -std::atan2(vy - (k_arc_height_multiplier * arrow.arc_height *
                           (arrow.t - k_arc_center_offset) / dist),
                     1.0F) *
         k_rad_to_deg;

+ 2 - 1
render/geom/patrol_flags.cpp

@@ -45,7 +45,8 @@ void renderPatrolFlags(Renderer *renderer, ResourceManager *resources,
     rendered_positions.insert(pos_hash);
   }
 
-  auto patrol_entities = world.get_entities_with<Engine::Core::PatrolComponent>();
+  auto patrol_entities =
+      world.get_entities_with<Engine::Core::PatrolComponent>();
 
   for (auto *entity : patrol_entities) {
     auto *patrol = entity->get_component<Engine::Core::PatrolComponent>();

+ 5 - 5
render/gl/camera.cpp

@@ -398,8 +398,8 @@ void Camera::update(float dt) {
   }
 }
 
-auto Camera::screenToGround(qreal sx, qreal sy, qreal screenW, qreal screenH,
-                            QVector3D &outWorld) const -> bool {
+auto Camera::screen_to_ground(qreal sx, qreal sy, qreal screenW, qreal screenH,
+                              QVector3D &outWorld) const -> bool {
   if (screenW <= 0 || screenH <= 0) {
     return false;
   }
@@ -447,8 +447,8 @@ auto Camera::screenToGround(qreal sx, qreal sy, qreal screenW, qreal screenH,
   return finite(outWorld);
 }
 
-auto Camera::worldToScreen(const QVector3D &world, qreal screenW, qreal screenH,
-                           QPointF &outScreen) const -> bool {
+auto Camera::world_to_screen(const QVector3D &world, qreal screenW,
+                             qreal screenH, QPointF &outScreen) const -> bool {
   if (screenW <= 0 || screenH <= 0) {
     return false;
   }
@@ -573,7 +573,7 @@ auto Camera::getViewProjectionMatrix() const -> QMatrix4x4 {
   return getProjectionMatrix() * getViewMatrix();
 }
 
-auto Camera::getDistance() const -> float {
+auto Camera::get_distance() const -> float {
   return (m_position - m_target).length();
 }
 

+ 9 - 7
render/gl/camera.h

@@ -49,10 +49,10 @@ public:
   void orbit(float yaw_deg, float pitch_deg);
 
   void update(float dt);
-  auto screenToGround(qreal sx, qreal sy, qreal screenW, qreal screenH,
-                      QVector3D &outWorld) const -> bool;
-  auto worldToScreen(const QVector3D &world, qreal screenW, qreal screenH,
-                     QPointF &outScreen) const -> bool;
+  auto screen_to_ground(qreal sx, qreal sy, qreal screenW, qreal screenH,
+                        QVector3D &outWorld) const -> bool;
+  auto world_to_screen(const QVector3D &world, qreal screenW, qreal screenH,
+                       QPointF &outScreen) const -> bool;
 
   void setFollowEnabled(bool enable) { m_followEnabled = enable; }
   [[nodiscard]] auto isFollowEnabled() const -> bool { return m_followEnabled; }
@@ -73,7 +73,9 @@ public:
   [[nodiscard]] auto getProjectionMatrix() const -> QMatrix4x4;
   [[nodiscard]] auto getViewProjectionMatrix() const -> QMatrix4x4;
 
-  [[nodiscard]] auto getTarget() const -> const QVector3D & { return m_target; }
+  [[nodiscard]] auto get_target() const -> const QVector3D & {
+    return m_target;
+  }
   [[nodiscard]] auto getUpVector() const -> const QVector3D & { return m_up; }
   [[nodiscard]] auto getRightVector() const -> const QVector3D & {
     return m_right;
@@ -81,10 +83,10 @@ public:
   [[nodiscard]] auto getForwardVector() const -> const QVector3D & {
     return m_front;
   }
-  [[nodiscard]] auto getPosition() const -> const QVector3D & {
+  [[nodiscard]] auto get_position() const -> const QVector3D & {
     return m_position;
   }
-  [[nodiscard]] auto getDistance() const -> float;
+  [[nodiscard]] auto get_distance() const -> float;
   [[nodiscard]] auto getPitchDeg() const -> float;
   [[nodiscard]] auto getFOV() const -> float { return m_fov; }
   [[nodiscard]] auto getAspect() const -> float { return m_aspect; }

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

@@ -33,14 +33,15 @@ auto sampleAnimState(const DrawContext &ctx) -> AnimationInputs {
       ctx.entity->get_component<Engine::Core::AttackTargetComponent>();
   auto *transform =
       ctx.entity->get_component<Engine::Core::TransformComponent>();
-  auto *hold_mode = ctx.entity->get_component<Engine::Core::HoldModeComponent>();
+  auto *hold_mode =
+      ctx.entity->get_component<Engine::Core::HoldModeComponent>();
 
   anim.is_in_hold_mode = ((hold_mode != nullptr) && hold_mode->active);
   if ((hold_mode != nullptr) && !hold_mode->active &&
-      hold_mode->exitCooldown > 0.0F) {
+      hold_mode->exit_cooldown > 0.0F) {
     anim.is_exiting_hold = true;
     anim.hold_exit_progress =
-        1.0F - (hold_mode->exitCooldown / hold_mode->standUpDuration);
+        1.0F - (hold_mode->exit_cooldown / hold_mode->stand_up_duration);
   }
   anim.is_moving = ((movement != nullptr) && movement->has_target);
 

+ 64 - 59
render/graphics_settings.h

@@ -60,7 +60,8 @@ public:
     applyPreset(q);
   }
 
-  [[nodiscard]] auto lod_multipliers() const noexcept -> const LODMultipliers & {
+  [[nodiscard]] auto
+  lod_multipliers() const noexcept -> const LODMultipliers & {
     return m_lod_multipliers;
   }
 
@@ -68,13 +69,14 @@ public:
     return m_features;
   }
 
-  [[nodiscard]] auto batching_config() const noexcept -> const BatchingConfig & {
+  [[nodiscard]] auto
+  batching_config() const noexcept -> const BatchingConfig & {
     return m_batching_config;
   }
 
   [[nodiscard]] auto
   calculate_batching_ratio(int visible_units,
-                         float camera_height) const noexcept -> float {
+                           float camera_height) const noexcept -> float {
     if (m_batching_config.never_batch) {
       return 0.0F;
     }
@@ -99,8 +101,9 @@ public:
       if (range > 0.0F) {
         zoom_factor =
             (camera_height - m_batching_config.batching_zoom_start) / range;
-        zoom_factor =
-            zoom_factor < 0.0F ? 0.0F : (zoom_factor > 1.0F ? 1.0F : zoom_factor);
+        zoom_factor = zoom_factor < 0.0F
+                          ? 0.0F
+                          : (zoom_factor > 1.0F ? 1.0F : zoom_factor);
       }
     }
 
@@ -110,10 +113,12 @@ public:
   [[nodiscard]] auto humanoid_full_detail_distance() const noexcept -> float {
     return kBaseHumanoidFull * m_lod_multipliers.humanoid_full;
   }
-  [[nodiscard]] auto humanoid_reduced_detail_distance() const noexcept -> float {
+  [[nodiscard]] auto
+  humanoid_reduced_detail_distance() const noexcept -> float {
     return kBaseHumanoidReduced * m_lod_multipliers.humanoid_reduced;
   }
-  [[nodiscard]] auto humanoid_minimal_detail_distance() const noexcept -> float {
+  [[nodiscard]] auto
+  humanoid_minimal_detail_distance() const noexcept -> float {
     return kBaseHumanoidMinimal * m_lod_multipliers.humanoid_minimal;
   }
   [[nodiscard]] auto humanoid_billboard_distance() const noexcept -> float {
@@ -148,15 +153,15 @@ private:
     case GraphicsQuality::Low:
 
       m_lod_multipliers = {.humanoid_full = 0.8F,
-                          .humanoid_reduced = 0.8F,
-                          .humanoid_minimal = 0.8F,
-                          .humanoid_billboard = 0.8F,
-                          .horse_full = 0.8F,
-                          .horse_reduced = 0.8F,
-                          .horse_minimal = 0.8F,
-                          .horse_billboard = 0.8F,
-                          .shadow_distance = 25.0F,
-                          .enable_shadows = true};
+                           .humanoid_reduced = 0.8F,
+                           .humanoid_minimal = 0.8F,
+                           .humanoid_billboard = 0.8F,
+                           .horse_full = 0.8F,
+                           .horse_reduced = 0.8F,
+                           .horse_minimal = 0.8F,
+                           .horse_billboard = 0.8F,
+                           .shadow_distance = 25.0F,
+                           .enable_shadows = true};
       m_features = {.enable_facial_hair = false,
                     .enable_mane_detail = false,
                     .enable_tail_detail = false,
@@ -165,24 +170,24 @@ private:
                     .enable_ground_shadows = true,
                     .enable_pose_cache = true};
       m_batching_config = {.force_batching = true,
-                          .never_batch = false,
-                          .batching_unit_threshold = 0,
-                          .batching_zoom_start = 0.0F,
-                          .batching_zoom_full = 0.0F};
+                           .never_batch = false,
+                           .batching_unit_threshold = 0,
+                           .batching_zoom_start = 0.0F,
+                           .batching_zoom_full = 0.0F};
       break;
 
     case GraphicsQuality::Medium:
 
       m_lod_multipliers = {.humanoid_full = 1.0F,
-                          .humanoid_reduced = 1.0F,
-                          .humanoid_minimal = 1.0F,
-                          .humanoid_billboard = 1.0F,
-                          .horse_full = 1.0F,
-                          .horse_reduced = 1.0F,
-                          .horse_minimal = 1.0F,
-                          .horse_billboard = 1.0F,
-                          .shadow_distance = 40.0F,
-                          .enable_shadows = true};
+                           .humanoid_reduced = 1.0F,
+                           .humanoid_minimal = 1.0F,
+                           .humanoid_billboard = 1.0F,
+                           .horse_full = 1.0F,
+                           .horse_reduced = 1.0F,
+                           .horse_minimal = 1.0F,
+                           .horse_billboard = 1.0F,
+                           .shadow_distance = 40.0F,
+                           .enable_shadows = true};
       m_features = {.enable_facial_hair = true,
                     .enable_mane_detail = true,
                     .enable_tail_detail = true,
@@ -192,24 +197,24 @@ private:
                     .enable_pose_cache = true};
 
       m_batching_config = {.force_batching = false,
-                          .never_batch = false,
-                          .batching_unit_threshold = 30,
-                          .batching_zoom_start = 60.0F,
-                          .batching_zoom_full = 90.0F};
+                           .never_batch = false,
+                           .batching_unit_threshold = 30,
+                           .batching_zoom_start = 60.0F,
+                           .batching_zoom_full = 90.0F};
       break;
 
     case GraphicsQuality::High:
 
       m_lod_multipliers = {.humanoid_full = 2.0F,
-                          .humanoid_reduced = 2.0F,
-                          .humanoid_minimal = 2.0F,
-                          .humanoid_billboard = 2.0F,
-                          .horse_full = 2.0F,
-                          .horse_reduced = 2.0F,
-                          .horse_minimal = 2.0F,
-                          .horse_billboard = 2.0F,
-                          .shadow_distance = 80.0F,
-                          .enable_shadows = true};
+                           .humanoid_reduced = 2.0F,
+                           .humanoid_minimal = 2.0F,
+                           .humanoid_billboard = 2.0F,
+                           .horse_full = 2.0F,
+                           .horse_reduced = 2.0F,
+                           .horse_minimal = 2.0F,
+                           .horse_billboard = 2.0F,
+                           .shadow_distance = 80.0F,
+                           .enable_shadows = true};
       m_features = {.enable_facial_hair = true,
                     .enable_mane_detail = true,
                     .enable_tail_detail = true,
@@ -219,24 +224,24 @@ private:
                     .enable_pose_cache = true};
 
       m_batching_config = {.force_batching = false,
-                          .never_batch = false,
-                          .batching_unit_threshold = 50,
-                          .batching_zoom_start = 80.0F,
-                          .batching_zoom_full = 120.0F};
+                           .never_batch = false,
+                           .batching_unit_threshold = 50,
+                           .batching_zoom_start = 80.0F,
+                           .batching_zoom_full = 120.0F};
       break;
 
     case GraphicsQuality::Ultra:
 
       m_lod_multipliers = {.humanoid_full = 100.0F,
-                          .humanoid_reduced = 100.0F,
-                          .humanoid_minimal = 100.0F,
-                          .humanoid_billboard = 100.0F,
-                          .horse_full = 100.0F,
-                          .horse_reduced = 100.0F,
-                          .horse_minimal = 100.0F,
-                          .horse_billboard = 100.0F,
-                          .shadow_distance = 200.0F,
-                          .enable_shadows = true};
+                           .humanoid_reduced = 100.0F,
+                           .humanoid_minimal = 100.0F,
+                           .humanoid_billboard = 100.0F,
+                           .horse_full = 100.0F,
+                           .horse_reduced = 100.0F,
+                           .horse_minimal = 100.0F,
+                           .horse_billboard = 100.0F,
+                           .shadow_distance = 200.0F,
+                           .enable_shadows = true};
       m_features = {.enable_facial_hair = true,
                     .enable_mane_detail = true,
                     .enable_tail_detail = true,
@@ -246,10 +251,10 @@ private:
                     .enable_pose_cache = false};
 
       m_batching_config = {.force_batching = false,
-                          .never_batch = true,
-                          .batching_unit_threshold = 999999,
-                          .batching_zoom_start = 999999.0F,
-                          .batching_zoom_full = 999999.0F};
+                           .never_batch = true,
+                           .batching_unit_threshold = 999999,
+                           .batching_zoom_start = 999999.0F,
+                           .batching_zoom_full = 999999.0F};
       break;
     }
   }

+ 5 - 4
render/humanoid/rig.cpp

@@ -1219,7 +1219,8 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
   Engine::Core::MovementComponent *movement_comp = nullptr;
   Engine::Core::TransformComponent *transform_comp = nullptr;
   if (ctx.entity != nullptr) {
-    movement_comp = ctx.entity->get_component<Engine::Core::MovementComponent>();
+    movement_comp =
+        ctx.entity->get_component<Engine::Core::MovementComponent>();
     transform_comp =
         ctx.entity->get_component<Engine::Core::TransformComponent>();
   }
@@ -1355,7 +1356,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
     float soldier_distance = 0.0F;
     if (ctx.camera != nullptr) {
       soldier_distance =
-          (soldier_world_pos - ctx.camera->getPosition()).length();
+          (soldier_world_pos - ctx.camera->get_position()).length();
       soldier_lod = calculateHumanoidLOD(soldier_distance);
 
       if (soldier_lod == HumanoidLOD::Billboard) {
@@ -1552,10 +1553,10 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
 
     const auto &gfxSettings = Render::GraphicsSettings::instance();
     const bool shouldRenderShadow =
-        gfxSettings.shadowsEnabled() &&
+        gfxSettings.shadows_enabled() &&
         (soldier_lod == HumanoidLOD::Full ||
          soldier_lod == HumanoidLOD::Reduced) &&
-        soldier_distance < gfxSettings.shadowMaxDistance();
+        soldier_distance < gfxSettings.shadow_max_distance();
 
     if (shouldRenderShadow && inst_ctx.backend != nullptr &&
         inst_ctx.resources != nullptr) {

+ 2 - 2
render/scene_renderer.cpp

@@ -392,7 +392,7 @@ void Renderer::renderWorld(Engine::Core::World *world) {
 
   float cameraHeight = 0.0F;
   if (m_camera != nullptr) {
-    cameraHeight = m_camera->getPosition().y();
+    cameraHeight = m_camera->get_position().y();
   }
 
   int visibleUnitCount = 0;
@@ -467,7 +467,7 @@ void Renderer::renderWorld(Engine::Core::World *world) {
         continue;
       }
 
-      QVector3D camPos = m_camera->getPosition();
+      QVector3D camPos = m_camera->get_position();
       float dx = unit_pos.x() - camPos.x();
       float dz = unit_pos.z() - camPos.z();
       distanceToCamera = std::sqrt(dx * dx + dz * dz);

+ 186 - 184
tests/core/serialization_test.cpp

@@ -23,10 +23,10 @@ protected:
 };
 
 TEST_F(SerializationTest, EntitySerializationBasic) {
-  auto *entity = world->createEntity();
+  auto *entity = world->create_entity();
   ASSERT_NE(entity, nullptr);
 
-  auto entity_id = entity->getId();
+  auto entity_id = entity->get_id();
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
@@ -36,8 +36,8 @@ TEST_F(SerializationTest, EntitySerializationBasic) {
 }
 
 TEST_F(SerializationTest, TransformComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *transform = entity->addComponent<TransformComponent>();
+  auto *entity = world->create_entity();
+  auto *transform = entity->add_component<TransformComponent>();
 
   transform->position.x = 10.5F;
   transform->position.y = 20.3F;
@@ -48,30 +48,30 @@ TEST_F(SerializationTest, TransformComponentSerialization) {
   transform->scale.x = 2.0F;
   transform->scale.y = 2.5F;
   transform->scale.z = 3.0F;
-  transform->hasDesiredYaw = true;
-  transform->desiredYaw = 45.0F;
+  transform->has_desired_yaw = true;
+  transform->desired_yaw = 45.0F;
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
   ASSERT_TRUE(json.contains("transform"));
   QJsonObject transform_obj = json["transform"].toObject();
 
-  EXPECT_FLOAT_EQ(transform_obj["posX"].toDouble(), 10.5);
-  EXPECT_FLOAT_EQ(transform_obj["posY"].toDouble(), 20.3);
-  EXPECT_FLOAT_EQ(transform_obj["posZ"].toDouble(), 30.1);
-  EXPECT_FLOAT_EQ(transform_obj["rotX"].toDouble(), 0.5);
-  EXPECT_FLOAT_EQ(transform_obj["rotY"].toDouble(), 1.0);
-  EXPECT_FLOAT_EQ(transform_obj["rotZ"].toDouble(), 1.5);
+  EXPECT_FLOAT_EQ(transform_obj["pos_x"].toDouble(), 10.5);
+  EXPECT_FLOAT_EQ(transform_obj["pos_y"].toDouble(), 20.3);
+  EXPECT_FLOAT_EQ(transform_obj["pos_z"].toDouble(), 30.1);
+  EXPECT_FLOAT_EQ(transform_obj["rot_x"].toDouble(), 0.5);
+  EXPECT_FLOAT_EQ(transform_obj["rot_y"].toDouble(), 1.0);
+  EXPECT_FLOAT_EQ(transform_obj["rot_z"].toDouble(), 1.5);
   EXPECT_FLOAT_EQ(transform_obj["scale_x"].toDouble(), 2.0);
-  EXPECT_FLOAT_EQ(transform_obj["scaleY"].toDouble(), 2.5);
+  EXPECT_FLOAT_EQ(transform_obj["scale_y"].toDouble(), 2.5);
   EXPECT_FLOAT_EQ(transform_obj["scale_z"].toDouble(), 3.0);
-  EXPECT_TRUE(transform_obj["hasDesiredYaw"].toBool());
-  EXPECT_FLOAT_EQ(transform_obj["desiredYaw"].toDouble(), 45.0);
+  EXPECT_TRUE(transform_obj["has_desired_yaw"].toBool());
+  EXPECT_FLOAT_EQ(transform_obj["desired_yaw"].toDouble(), 45.0);
 }
 
 TEST_F(SerializationTest, UnitComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *unit = entity->addComponent<UnitComponent>();
+  auto *entity = world->create_entity();
+  auto *unit = entity->add_component<UnitComponent>();
 
   unit->health = 80;
   unit->max_health = 100;
@@ -96,22 +96,22 @@ TEST_F(SerializationTest, UnitComponentSerialization) {
 }
 
 TEST_F(SerializationTest, MovementComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *movement = entity->addComponent<MovementComponent>();
+  auto *entity = world->create_entity();
+  auto *movement = entity->add_component<MovementComponent>();
 
-  movement->hasTarget = true;
+  movement->has_target = true;
   movement->target_x = 50.0F;
   movement->target_y = 60.0F;
-  movement->goalX = 55.0F;
-  movement->goalY = 65.0F;
+  movement->goal_x = 55.0F;
+  movement->goal_y = 65.0F;
   movement->vx = 1.5F;
   movement->vz = 2.0F;
-  movement->pathPending = false;
-  movement->pendingRequestId = 42;
-  movement->repathCooldown = 1.0F;
-  movement->lastGoalX = 45.0F;
-  movement->lastGoalY = 55.0F;
-  movement->timeSinceLastPathRequest = 0.5F;
+  movement->path_pending = false;
+  movement->pending_request_id = 42;
+  movement->repath_cooldown = 1.0F;
+  movement->last_goal_x = 45.0F;
+  movement->last_goal_y = 55.0F;
+  movement->time_since_last_path_request = 0.5F;
 
   movement->path.emplace_back(10.0F, 20.0F);
   movement->path.emplace_back(30.0F, 40.0F);
@@ -121,15 +121,16 @@ TEST_F(SerializationTest, MovementComponentSerialization) {
   ASSERT_TRUE(json.contains("movement"));
   QJsonObject movement_obj = json["movement"].toObject();
 
-  EXPECT_TRUE(movement_obj["hasTarget"].toBool());
+  EXPECT_TRUE(movement_obj["has_target"].toBool());
   EXPECT_FLOAT_EQ(movement_obj["target_x"].toDouble(), 50.0);
   EXPECT_FLOAT_EQ(movement_obj["target_y"].toDouble(), 60.0);
-  EXPECT_FLOAT_EQ(movement_obj["goalX"].toDouble(), 55.0);
-  EXPECT_FLOAT_EQ(movement_obj["goalY"].toDouble(), 65.0);
+  EXPECT_FLOAT_EQ(movement_obj["goal_x"].toDouble(), 55.0);
+  EXPECT_FLOAT_EQ(movement_obj["goal_y"].toDouble(), 65.0);
   EXPECT_FLOAT_EQ(movement_obj["vx"].toDouble(), 1.5);
   EXPECT_FLOAT_EQ(movement_obj["vz"].toDouble(), 2.0);
-  EXPECT_FALSE(movement_obj["pathPending"].toBool());
-  EXPECT_EQ(movement_obj["pendingRequestId"].toVariant().toULongLong(), 42ULL);
+  EXPECT_FALSE(movement_obj["path_pending"].toBool());
+  EXPECT_EQ(movement_obj["pending_request_id"].toVariant().toULongLong(),
+            42ULL);
 
   ASSERT_TRUE(movement_obj.contains("path"));
   QJsonArray path_array = movement_obj["path"].toArray();
@@ -145,23 +146,23 @@ TEST_F(SerializationTest, MovementComponentSerialization) {
 }
 
 TEST_F(SerializationTest, AttackComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *attack = entity->addComponent<AttackComponent>();
+  auto *entity = world->create_entity();
+  auto *attack = entity->add_component<AttackComponent>();
 
   attack->range = 10.0F;
   attack->damage = 25;
   attack->cooldown = 2.0F;
-  attack->timeSinceLast = 0.5F;
-  attack->meleeRange = 2.0F;
-  attack->meleeDamage = 15;
-  attack->meleeCooldown = 1.5F;
-  attack->preferredMode = AttackComponent::CombatMode::Ranged;
-  attack->currentMode = AttackComponent::CombatMode::Ranged;
-  attack->canMelee = true;
-  attack->canRanged = true;
-  attack->max_heightDifference = 5.0F;
-  attack->inMeleeLock = false;
-  attack->meleeLockTargetId = 0;
+  attack->time_since_last = 0.5F;
+  attack->melee_range = 2.0F;
+  attack->melee_damage = 15;
+  attack->melee_cooldown = 1.5F;
+  attack->preferred_mode = AttackComponent::CombatMode::Ranged;
+  attack->current_mode = AttackComponent::CombatMode::Ranged;
+  attack->can_melee = true;
+  attack->can_ranged = true;
+  attack->max_height_difference = 5.0F;
+  attack->in_melee_lock = false;
+  attack->melee_lock_target_id = 0;
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
@@ -171,42 +172,43 @@ TEST_F(SerializationTest, AttackComponentSerialization) {
   EXPECT_FLOAT_EQ(attack_obj["range"].toDouble(), 10.0);
   EXPECT_EQ(attack_obj["damage"].toInt(), 25);
   EXPECT_FLOAT_EQ(attack_obj["cooldown"].toDouble(), 2.0);
-  EXPECT_FLOAT_EQ(attack_obj["timeSinceLast"].toDouble(), 0.5);
-  EXPECT_FLOAT_EQ(attack_obj["meleeRange"].toDouble(), 2.0);
-  EXPECT_EQ(attack_obj["meleeDamage"].toInt(), 15);
-  EXPECT_FLOAT_EQ(attack_obj["meleeCooldown"].toDouble(), 1.5);
-  EXPECT_EQ(attack_obj["preferredMode"].toString(), QString("ranged"));
-  EXPECT_EQ(attack_obj["currentMode"].toString(), QString("ranged"));
-  EXPECT_TRUE(attack_obj["canMelee"].toBool());
-  EXPECT_TRUE(attack_obj["canRanged"].toBool());
-  EXPECT_FLOAT_EQ(attack_obj["max_heightDifference"].toDouble(), 5.0);
-  EXPECT_FALSE(attack_obj["inMeleeLock"].toBool());
+  EXPECT_FLOAT_EQ(attack_obj["time_since_last"].toDouble(), 0.5);
+  EXPECT_FLOAT_EQ(attack_obj["melee_range"].toDouble(), 2.0);
+  EXPECT_EQ(attack_obj["melee_damage"].toInt(), 15);
+  EXPECT_FLOAT_EQ(attack_obj["melee_cooldown"].toDouble(), 1.5);
+  EXPECT_EQ(attack_obj["preferred_mode"].toString(), QString("ranged"));
+  EXPECT_EQ(attack_obj["current_mode"].toString(), QString("ranged"));
+  EXPECT_TRUE(attack_obj["can_melee"].toBool());
+  EXPECT_TRUE(attack_obj["can_ranged"].toBool());
+  EXPECT_FLOAT_EQ(attack_obj["max_height_difference"].toDouble(), 5.0);
+  EXPECT_FALSE(attack_obj["in_melee_lock"].toBool());
 }
 
 TEST_F(SerializationTest, EntityDeserializationRoundTrip) {
-  auto *original_entity = world->createEntity();
-  auto *transform = original_entity->addComponent<TransformComponent>();
+  auto *original_entity = world->create_entity();
+  auto *transform = original_entity->add_component<TransformComponent>();
   transform->position.x = 100.0F;
   transform->position.y = 200.0F;
   transform->position.z = 300.0F;
 
-  auto *unit = original_entity->addComponent<UnitComponent>();
+  auto *unit = original_entity->add_component<UnitComponent>();
   unit->health = 75;
   unit->max_health = 100;
   unit->speed = 6.0F;
 
   QJsonObject json = Serialization::serializeEntity(original_entity);
 
-  auto *new_entity = world->createEntity();
+  auto *new_entity = world->create_entity();
   Serialization::deserializeEntity(new_entity, json);
 
-  auto *deserialized_transform = new_entity->getComponent<TransformComponent>();
+  auto *deserialized_transform =
+      new_entity->get_component<TransformComponent>();
   ASSERT_NE(deserialized_transform, nullptr);
   EXPECT_FLOAT_EQ(deserialized_transform->position.x, 100.0F);
   EXPECT_FLOAT_EQ(deserialized_transform->position.y, 200.0F);
   EXPECT_FLOAT_EQ(deserialized_transform->position.z, 300.0F);
 
-  auto *deserialized_unit = new_entity->getComponent<UnitComponent>();
+  auto *deserialized_unit = new_entity->get_component<UnitComponent>();
   ASSERT_NE(deserialized_unit, nullptr);
   EXPECT_EQ(deserialized_unit->health, 75);
   EXPECT_EQ(deserialized_unit->max_health, 100);
@@ -221,10 +223,10 @@ TEST_F(SerializationTest, DeserializationWithMissingFields) {
   unit_obj["health"] = 50;
   json["unit"] = unit_obj;
 
-  auto *entity = world->createEntity();
+  auto *entity = world->create_entity();
   Serialization::deserializeEntity(entity, json);
 
-  auto *unit = entity->getComponent<UnitComponent>();
+  auto *unit = entity->get_component<UnitComponent>();
   ASSERT_NE(unit, nullptr);
   EXPECT_EQ(unit->health, 50);
   EXPECT_EQ(unit->max_health, Defaults::kUnitDefaultHealth);
@@ -235,25 +237,25 @@ TEST_F(SerializationTest, DeserializationWithMalformedJSON) {
   json["id"] = 1;
 
   QJsonObject transform_obj;
-  transform_obj["posX"] = "not_a_number";
+  transform_obj["pos_x"] = "not_a_number";
   json["transform"] = transform_obj;
 
-  auto *entity = world->createEntity();
+  auto *entity = world->create_entity();
 
   EXPECT_NO_THROW({ Serialization::deserializeEntity(entity, json); });
 
-  auto *transform = entity->getComponent<TransformComponent>();
+  auto *transform = entity->get_component<TransformComponent>();
   ASSERT_NE(transform, nullptr);
   EXPECT_FLOAT_EQ(transform->position.x, 0.0F);
 }
 
 TEST_F(SerializationTest, WorldSerializationRoundTrip) {
-  auto *entity1 = world->createEntity();
-  auto *transform1 = entity1->addComponent<TransformComponent>();
+  auto *entity1 = world->create_entity();
+  auto *transform1 = entity1->add_component<TransformComponent>();
   transform1->position.x = 10.0F;
 
-  auto *entity2 = world->createEntity();
-  auto *transform2 = entity2->addComponent<TransformComponent>();
+  auto *entity2 = world->create_entity();
+  auto *transform2 = entity2->add_component<TransformComponent>();
   transform2->position.x = 20.0F;
 
   QJsonDocument doc = Serialization::serializeWorld(world.get());
@@ -267,13 +269,13 @@ TEST_F(SerializationTest, WorldSerializationRoundTrip) {
   auto new_world = std::make_unique<World>();
   Serialization::deserializeWorld(new_world.get(), doc);
 
-  const auto &entities = new_world->getEntities();
+  const auto &entities = new_world->get_entities();
   EXPECT_EQ(entities.size(), 2UL);
 }
 
 TEST_F(SerializationTest, SaveAndLoadFromFile) {
-  auto *entity = world->createEntity();
-  auto *transform = entity->addComponent<TransformComponent>();
+  auto *entity = world->create_entity();
+  auto *transform = entity->add_component<TransformComponent>();
   transform->position.x = 42.0F;
   transform->position.y = 43.0F;
   transform->position.z = 44.0F;
@@ -293,12 +295,12 @@ TEST_F(SerializationTest, SaveAndLoadFromFile) {
   auto new_world = std::make_unique<World>();
   Serialization::deserializeWorld(new_world.get(), loaded_doc);
 
-  const auto &entities = new_world->getEntities();
+  const auto &entities = new_world->get_entities();
   EXPECT_EQ(entities.size(), 1UL);
 
   if (!entities.empty()) {
     auto *loaded_entity = entities.begin()->second.get();
-    auto *loaded_transform = loaded_entity->getComponent<TransformComponent>();
+    auto *loaded_transform = loaded_entity->get_component<TransformComponent>();
     ASSERT_NE(loaded_transform, nullptr);
     EXPECT_FLOAT_EQ(loaded_transform->position.x, 42.0F);
     EXPECT_FLOAT_EQ(loaded_transform->position.y, 43.0F);
@@ -307,37 +309,37 @@ TEST_F(SerializationTest, SaveAndLoadFromFile) {
 }
 
 TEST_F(SerializationTest, ProductionComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *production = entity->addComponent<ProductionComponent>();
-
-  production->inProgress = true;
-  production->buildTime = 10.0F;
-  production->timeRemaining = 5.0F;
-  production->producedCount = 3;
-  production->maxUnits = 10;
+  auto *entity = world->create_entity();
+  auto *production = entity->add_component<ProductionComponent>();
+
+  production->in_progress = true;
+  production->build_time = 10.0F;
+  production->time_remaining = 5.0F;
+  production->produced_count = 3;
+  production->max_units = 10;
   production->product_type = Game::Units::TroopType::Archer;
-  production->rallyX = 100.0F;
-  production->rallyZ = 200.0F;
-  production->rallySet = true;
-  production->villagerCost = 2;
-  production->productionQueue.push_back(Game::Units::TroopType::Spearman);
-  production->productionQueue.push_back(Game::Units::TroopType::Archer);
+  production->rally_x = 100.0F;
+  production->rally_z = 200.0F;
+  production->rally_set = true;
+  production->villager_cost = 2;
+  production->production_queue.push_back(Game::Units::TroopType::Spearman);
+  production->production_queue.push_back(Game::Units::TroopType::Archer);
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
   ASSERT_TRUE(json.contains("production"));
   QJsonObject prod_obj = json["production"].toObject();
 
-  EXPECT_TRUE(prod_obj["inProgress"].toBool());
-  EXPECT_FLOAT_EQ(prod_obj["buildTime"].toDouble(), 10.0);
-  EXPECT_FLOAT_EQ(prod_obj["timeRemaining"].toDouble(), 5.0);
-  EXPECT_EQ(prod_obj["producedCount"].toInt(), 3);
-  EXPECT_EQ(prod_obj["maxUnits"].toInt(), 10);
+  EXPECT_TRUE(prod_obj["in_progress"].toBool());
+  EXPECT_FLOAT_EQ(prod_obj["build_time"].toDouble(), 10.0);
+  EXPECT_FLOAT_EQ(prod_obj["time_remaining"].toDouble(), 5.0);
+  EXPECT_EQ(prod_obj["produced_count"].toInt(), 3);
+  EXPECT_EQ(prod_obj["max_units"].toInt(), 10);
   EXPECT_EQ(prod_obj["product_type"].toString(), QString("archer"));
-  EXPECT_FLOAT_EQ(prod_obj["rallyX"].toDouble(), 100.0);
-  EXPECT_FLOAT_EQ(prod_obj["rallyZ"].toDouble(), 200.0);
-  EXPECT_TRUE(prod_obj["rallySet"].toBool());
-  EXPECT_EQ(prod_obj["villagerCost"].toInt(), 2);
+  EXPECT_FLOAT_EQ(prod_obj["rally_x"].toDouble(), 100.0);
+  EXPECT_FLOAT_EQ(prod_obj["rally_z"].toDouble(), 200.0);
+  EXPECT_TRUE(prod_obj["rally_set"].toBool());
+  EXPECT_EQ(prod_obj["villager_cost"].toInt(), 2);
 
   ASSERT_TRUE(prod_obj.contains("queue"));
   QJsonArray queue = prod_obj["queue"].toArray();
@@ -347,10 +349,10 @@ TEST_F(SerializationTest, ProductionComponentSerialization) {
 }
 
 TEST_F(SerializationTest, PatrolComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *patrol = entity->addComponent<PatrolComponent>();
+  auto *entity = world->create_entity();
+  auto *patrol = entity->add_component<PatrolComponent>();
 
-  patrol->currentWaypoint = 1;
+  patrol->current_waypoint = 1;
   patrol->patrolling = true;
   patrol->waypoints.emplace_back(10.0F, 20.0F);
   patrol->waypoints.emplace_back(30.0F, 40.0F);
@@ -361,7 +363,7 @@ TEST_F(SerializationTest, PatrolComponentSerialization) {
   ASSERT_TRUE(json.contains("patrol"));
   QJsonObject patrol_obj = json["patrol"].toObject();
 
-  EXPECT_EQ(patrol_obj["currentWaypoint"].toInt(), 1);
+  EXPECT_EQ(patrol_obj["current_waypoint"].toInt(), 1);
   EXPECT_TRUE(patrol_obj["patrolling"].toBool());
 
   ASSERT_TRUE(patrol_obj.contains("waypoints"));
@@ -374,13 +376,13 @@ TEST_F(SerializationTest, PatrolComponentSerialization) {
 }
 
 TEST_F(SerializationTest, RenderableComponentSerialization) {
-  auto *entity = world->createEntity();
+  auto *entity = world->create_entity();
   auto *renderable =
-      entity->addComponent<RenderableComponent>("mesh.obj", "texture.png");
+      entity->add_component<RenderableComponent>("mesh.obj", "texture.png");
 
-  renderable->meshPath = "models/archer.obj";
-  renderable->texturePath = "textures/archer_diffuse.png";
-  renderable->rendererId = "archer_renderer";
+  renderable->mesh_path = "models/archer.obj";
+  renderable->texture_path = "textures/archer_diffuse.png";
+  renderable->renderer_id = "archer_renderer";
   renderable->visible = true;
   renderable->mesh = RenderableComponent::MeshKind::Capsule;
   renderable->color = {0.8F, 0.2F, 0.5F};
@@ -390,11 +392,11 @@ TEST_F(SerializationTest, RenderableComponentSerialization) {
   ASSERT_TRUE(json.contains("renderable"));
   QJsonObject renderable_obj = json["renderable"].toObject();
 
-  EXPECT_EQ(renderable_obj["meshPath"].toString(),
+  EXPECT_EQ(renderable_obj["mesh_path"].toString(),
             QString("models/archer.obj"));
-  EXPECT_EQ(renderable_obj["texturePath"].toString(),
+  EXPECT_EQ(renderable_obj["texture_path"].toString(),
             QString("textures/archer_diffuse.png"));
-  EXPECT_EQ(renderable_obj["rendererId"].toString(),
+  EXPECT_EQ(renderable_obj["renderer_id"].toString(),
             QString("archer_renderer"));
   EXPECT_TRUE(renderable_obj["visible"].toBool());
   EXPECT_EQ(renderable_obj["mesh"].toInt(),
@@ -409,24 +411,24 @@ TEST_F(SerializationTest, RenderableComponentSerialization) {
 }
 
 TEST_F(SerializationTest, RenderableComponentRoundTrip) {
-  auto *original_entity = world->createEntity();
-  auto *renderable = original_entity->addComponent<RenderableComponent>(
+  auto *original_entity = world->create_entity();
+  auto *renderable = original_entity->add_component<RenderableComponent>(
       "test.obj", "test.png");
-  renderable->meshPath = "models/building.obj";
-  renderable->texturePath = "textures/building.png";
+  renderable->mesh_path = "models/building.obj";
+  renderable->texture_path = "textures/building.png";
   renderable->visible = false;
   renderable->mesh = RenderableComponent::MeshKind::Quad;
   renderable->color = {1.0F, 0.5F, 0.25F};
 
   QJsonObject json = Serialization::serializeEntity(original_entity);
 
-  auto *new_entity = world->createEntity();
+  auto *new_entity = world->create_entity();
   Serialization::deserializeEntity(new_entity, json);
 
-  auto *deserialized = new_entity->getComponent<RenderableComponent>();
+  auto *deserialized = new_entity->get_component<RenderableComponent>();
   ASSERT_NE(deserialized, nullptr);
-  EXPECT_EQ(deserialized->meshPath, "models/building.obj");
-  EXPECT_EQ(deserialized->texturePath, "textures/building.png");
+  EXPECT_EQ(deserialized->mesh_path, "models/building.obj");
+  EXPECT_EQ(deserialized->texture_path, "textures/building.png");
   EXPECT_FALSE(deserialized->visible);
   EXPECT_EQ(deserialized->mesh, RenderableComponent::MeshKind::Quad);
   EXPECT_FLOAT_EQ(deserialized->color[0], 1.0F);
@@ -435,11 +437,11 @@ TEST_F(SerializationTest, RenderableComponentRoundTrip) {
 }
 
 TEST_F(SerializationTest, AttackTargetComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *attack_target = entity->addComponent<AttackTargetComponent>();
+  auto *entity = world->create_entity();
+  auto *attack_target = entity->add_component<AttackTargetComponent>();
 
   attack_target->target_id = 42;
-  attack_target->shouldChase = true;
+  attack_target->should_chase = true;
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
@@ -447,29 +449,29 @@ TEST_F(SerializationTest, AttackTargetComponentSerialization) {
   QJsonObject attack_target_obj = json["attack_target"].toObject();
 
   EXPECT_EQ(attack_target_obj["target_id"].toVariant().toULongLong(), 42ULL);
-  EXPECT_TRUE(attack_target_obj["shouldChase"].toBool());
+  EXPECT_TRUE(attack_target_obj["should_chase"].toBool());
 }
 
 TEST_F(SerializationTest, AttackTargetComponentRoundTrip) {
-  auto *original_entity = world->createEntity();
-  auto *attack_target = original_entity->addComponent<AttackTargetComponent>();
+  auto *original_entity = world->create_entity();
+  auto *attack_target = original_entity->add_component<AttackTargetComponent>();
   attack_target->target_id = 123;
-  attack_target->shouldChase = false;
+  attack_target->should_chase = false;
 
   QJsonObject json = Serialization::serializeEntity(original_entity);
 
-  auto *new_entity = world->createEntity();
+  auto *new_entity = world->create_entity();
   Serialization::deserializeEntity(new_entity, json);
 
-  auto *deserialized = new_entity->getComponent<AttackTargetComponent>();
+  auto *deserialized = new_entity->get_component<AttackTargetComponent>();
   ASSERT_NE(deserialized, nullptr);
   EXPECT_EQ(deserialized->target_id, 123U);
-  EXPECT_FALSE(deserialized->shouldChase);
+  EXPECT_FALSE(deserialized->should_chase);
 }
 
 TEST_F(SerializationTest, BuildingComponentSerialization) {
-  auto *entity = world->createEntity();
-  entity->addComponent<BuildingComponent>();
+  auto *entity = world->create_entity();
+  entity->add_component<BuildingComponent>();
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
@@ -478,21 +480,21 @@ TEST_F(SerializationTest, BuildingComponentSerialization) {
 }
 
 TEST_F(SerializationTest, BuildingComponentRoundTrip) {
-  auto *original_entity = world->createEntity();
-  original_entity->addComponent<BuildingComponent>();
+  auto *original_entity = world->create_entity();
+  original_entity->add_component<BuildingComponent>();
 
   QJsonObject json = Serialization::serializeEntity(original_entity);
 
-  auto *new_entity = world->createEntity();
+  auto *new_entity = world->create_entity();
   Serialization::deserializeEntity(new_entity, json);
 
-  auto *deserialized = new_entity->getComponent<BuildingComponent>();
+  auto *deserialized = new_entity->get_component<BuildingComponent>();
   ASSERT_NE(deserialized, nullptr);
 }
 
 TEST_F(SerializationTest, AIControlledComponentSerialization) {
-  auto *entity = world->createEntity();
-  entity->addComponent<AIControlledComponent>();
+  auto *entity = world->create_entity();
+  entity->add_component<AIControlledComponent>();
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
@@ -501,26 +503,26 @@ TEST_F(SerializationTest, AIControlledComponentSerialization) {
 }
 
 TEST_F(SerializationTest, AIControlledComponentRoundTrip) {
-  auto *original_entity = world->createEntity();
-  original_entity->addComponent<AIControlledComponent>();
+  auto *original_entity = world->create_entity();
+  original_entity->add_component<AIControlledComponent>();
 
   QJsonObject json = Serialization::serializeEntity(original_entity);
 
-  auto *new_entity = world->createEntity();
+  auto *new_entity = world->create_entity();
   Serialization::deserializeEntity(new_entity, json);
 
-  auto *deserialized = new_entity->getComponent<AIControlledComponent>();
+  auto *deserialized = new_entity->get_component<AIControlledComponent>();
   ASSERT_NE(deserialized, nullptr);
 }
 
 TEST_F(SerializationTest, CaptureComponentSerialization) {
-  auto *entity = world->createEntity();
-  auto *capture = entity->addComponent<CaptureComponent>();
+  auto *entity = world->create_entity();
+  auto *capture = entity->add_component<CaptureComponent>();
 
   capture->capturing_player_id = 2;
-  capture->captureProgress = 7.5F;
-  capture->requiredTime = 15.0F;
-  capture->isBeingCaptured = true;
+  capture->capture_progress = 7.5F;
+  capture->required_time = 15.0F;
+  capture->is_being_captured = true;
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
@@ -528,67 +530,67 @@ TEST_F(SerializationTest, CaptureComponentSerialization) {
   QJsonObject capture_obj = json["capture"].toObject();
 
   EXPECT_EQ(capture_obj["capturing_player_id"].toInt(), 2);
-  EXPECT_FLOAT_EQ(capture_obj["captureProgress"].toDouble(), 7.5);
-  EXPECT_FLOAT_EQ(capture_obj["requiredTime"].toDouble(), 15.0);
-  EXPECT_TRUE(capture_obj["isBeingCaptured"].toBool());
+  EXPECT_FLOAT_EQ(capture_obj["capture_progress"].toDouble(), 7.5);
+  EXPECT_FLOAT_EQ(capture_obj["required_time"].toDouble(), 15.0);
+  EXPECT_TRUE(capture_obj["is_being_captured"].toBool());
 }
 
 TEST_F(SerializationTest, CaptureComponentRoundTrip) {
-  auto *original_entity = world->createEntity();
-  auto *capture = original_entity->addComponent<CaptureComponent>();
+  auto *original_entity = world->create_entity();
+  auto *capture = original_entity->add_component<CaptureComponent>();
   capture->capturing_player_id = 3;
-  capture->captureProgress = 10.0F;
-  capture->requiredTime = 20.0F;
-  capture->isBeingCaptured = false;
+  capture->capture_progress = 10.0F;
+  capture->required_time = 20.0F;
+  capture->is_being_captured = false;
 
   QJsonObject json = Serialization::serializeEntity(original_entity);
 
-  auto *new_entity = world->createEntity();
+  auto *new_entity = world->create_entity();
   Serialization::deserializeEntity(new_entity, json);
 
-  auto *deserialized = new_entity->getComponent<CaptureComponent>();
+  auto *deserialized = new_entity->get_component<CaptureComponent>();
   ASSERT_NE(deserialized, nullptr);
   EXPECT_EQ(deserialized->capturing_player_id, 3);
-  EXPECT_FLOAT_EQ(deserialized->captureProgress, 10.0F);
-  EXPECT_FLOAT_EQ(deserialized->requiredTime, 20.0F);
-  EXPECT_FALSE(deserialized->isBeingCaptured);
+  EXPECT_FLOAT_EQ(deserialized->capture_progress, 10.0F);
+  EXPECT_FLOAT_EQ(deserialized->required_time, 20.0F);
+  EXPECT_FALSE(deserialized->is_being_captured);
 }
 
 TEST_F(SerializationTest, CompleteEntityWithAllComponents) {
-  auto *entity = world->createEntity();
+  auto *entity = world->create_entity();
 
-  auto *transform = entity->addComponent<TransformComponent>();
+  auto *transform = entity->add_component<TransformComponent>();
   transform->position.x = 50.0F;
   transform->position.y = 10.0F;
   transform->position.z = 30.0F;
 
   auto *renderable =
-      entity->addComponent<RenderableComponent>("mesh.obj", "tex.png");
+      entity->add_component<RenderableComponent>("mesh.obj", "tex.png");
   renderable->visible = true;
 
-  auto *unit = entity->addComponent<UnitComponent>();
+  auto *unit = entity->add_component<UnitComponent>();
   unit->health = 100;
   unit->max_health = 100;
 
-  auto *movement = entity->addComponent<MovementComponent>();
-  movement->hasTarget = true;
+  auto *movement = entity->add_component<MovementComponent>();
+  movement->has_target = true;
   movement->target_x = 100.0F;
 
-  auto *attack = entity->addComponent<AttackComponent>();
+  auto *attack = entity->add_component<AttackComponent>();
   attack->damage = 25;
 
-  auto *attack_target = entity->addComponent<AttackTargetComponent>();
+  auto *attack_target = entity->add_component<AttackTargetComponent>();
   attack_target->target_id = 99;
 
-  entity->addComponent<BuildingComponent>();
+  entity->add_component<BuildingComponent>();
 
-  auto *production = entity->addComponent<ProductionComponent>();
-  production->inProgress = true;
+  auto *production = entity->add_component<ProductionComponent>();
+  production->in_progress = true;
 
-  entity->addComponent<AIControlledComponent>();
+  entity->add_component<AIControlledComponent>();
 
-  auto *capture = entity->addComponent<CaptureComponent>();
-  capture->isBeingCaptured = true;
+  auto *capture = entity->add_component<CaptureComponent>();
+  capture->is_being_captured = true;
 
   QJsonObject json = Serialization::serializeEntity(entity);
 
@@ -603,19 +605,19 @@ TEST_F(SerializationTest, CompleteEntityWithAllComponents) {
   EXPECT_TRUE(json.contains("aiControlled"));
   EXPECT_TRUE(json.contains("capture"));
 
-  auto *new_entity = world->createEntity();
+  auto *new_entity = world->create_entity();
   Serialization::deserializeEntity(new_entity, json);
 
-  EXPECT_NE(new_entity->getComponent<TransformComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<RenderableComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<UnitComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<MovementComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<AttackComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<AttackTargetComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<BuildingComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<ProductionComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<AIControlledComponent>(), nullptr);
-  EXPECT_NE(new_entity->getComponent<CaptureComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<TransformComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<RenderableComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<UnitComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<MovementComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<AttackComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<AttackTargetComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<BuildingComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<ProductionComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<AIControlledComponent>(), nullptr);
+  EXPECT_NE(new_entity->get_component<CaptureComponent>(), nullptr);
 }
 
 TEST_F(SerializationTest, EmptyWorldSerialization) {

+ 3 - 3
ui/qml/GameView.qml

@@ -123,11 +123,11 @@ Item {
             event.accepted = true;
             break;
         case Qt.Key_R:
-            game.camera_orbitDirection(1, shiftHeld);
+            game.camera_orbit_direction(1, shiftHeld);
             event.accepted = true;
             break;
         case Qt.Key_F:
-            game.camera_orbitDirection(-1, shiftHeld);
+            game.camera_orbit_direction(-1, shiftHeld);
             event.accepted = true;
             break;
         case Qt.Key_X:
@@ -231,7 +231,7 @@ Item {
         }
 
         Connections {
-            function onCursorModeChanged() {
+            function onCursor_mode_changed() {
                 if (typeof game !== 'undefined' && game.cursor_mode)
                     gameView.cursorMode = game.cursor_mode;
 

+ 1 - 1
ui/qml/HUD.qml

@@ -27,7 +27,7 @@ Item {
     }
 
     Connections {
-        function onSelectedUnitsChanged() {
+        function onSelected_units_changed() {
             selectionTick += 1;
             var hasTroops = false;
             if (typeof game !== 'undefined' && game.has_units_selected && game.has_selected_type) {

+ 1 - 1
ui/qml/HUDBottom.qml

@@ -409,7 +409,7 @@ RowLayout {
                 ToolTip.delay: 500
 
                 Connections {
-                    function onHoldModeChanged(active) {
+                    function onHold_mode_changed(active) {
                         holdButton.isHoldActive = (typeof game !== 'undefined' && game.any_selected_in_hold_mode) ? game.any_selected_in_hold_mode() : false;
                     }
 

+ 1 - 1
ui/qml/HUDVictory.qml

@@ -30,7 +30,7 @@ Rectangle {
     }
 
     Connections {
-        function onVictoryStateChanged() {
+        function onVictory_state_changed() {
             if (typeof game !== 'undefined' && game.victory_state === "")
                 resetState();
             else if (typeof game !== 'undefined' && game.victory_state !== "")

+ 1 - 1
ui/qml/LoadGamePanel.qml

@@ -52,7 +52,7 @@ Item {
     }
 
     Connections {
-        function onSaveSlotsChanged() {
+        function onSave_slots_changed() {
             if (typeof loadListModel === 'undefined')
                 return ;
 

+ 1 - 1
ui/qml/Main.qml

@@ -444,7 +444,7 @@ ApplicationWindow {
     }
 
     Connections {
-        function onLastErrorChanged() {
+        function onLast_error_changed() {
             if (game.last_error !== "")
                 errorDialog.open();
 

+ 58 - 57
ui/qml/ProductionPanel.qml

@@ -15,14 +15,15 @@ Rectangle {
     function defaultProductionState() {
         return {
             "has_barracks": false,
-            "producedCount": 0,
-            "maxUnits": 0,
-            "queueSize": 0,
-            "inProgress": false,
-            "productionQueue": [],
+            "produced_count": 0,
+            "max_units": 0,
+            "queue_size": 0,
+            "in_progress": false,
+            "production_queue": [],
             "product_type": "",
-            "villagerCost": 1,
-            "buildTime": 0,
+            "villager_cost": 1,
+            "build_time": 0,
+            "time_remaining": 0,
             "nation_id": ""
         };
     }
@@ -72,7 +73,7 @@ Rectangle {
             spacing: 8
 
             Rectangle {
-                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.hasSelectedType && productionPanel.gameInstance.hasSelectedType("barracks")))
+                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.has_selected_type && productionPanel.gameInstance.has_selected_type("barracks")))
 
                 width: parent.width
                 height: productionContent.height + 16
@@ -85,7 +86,7 @@ Rectangle {
                 Column {
                     id: productionContent
 
-                    property var prod: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.getSelectedProductionState) ? productionPanel.gameInstance.getSelectedProductionState() : productionPanel.defaultProductionState())
+                    property var prod: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.get_selected_production_state) ? productionPanel.gameInstance.get_selected_production_state() : productionPanel.defaultProductionState())
 
                     anchors.horizontalCenter: parent.horizontalCenter
                     anchors.top: parent.top
@@ -109,19 +110,19 @@ Rectangle {
                             model: 5
 
                             Rectangle {
-                                property int queueTotal: (productionContent.prod.inProgress ? 1 : 0) + (productionContent.prod.queueSize || 0)
+                                property int queueTotal: (productionContent.prod.in_progress ? 1 : 0) + (productionContent.prod.queue_size || 0)
                                 property bool isOccupied: index < queueTotal
-                                property bool isProducing: index === 0 && productionContent.prod.inProgress
+                                property bool isProducing: index === 0 && productionContent.prod.in_progress
                                 property string queueUnitType: {
                                     if (!isOccupied)
                                         return "";
 
-                                    if (index === 0 && productionContent.prod.inProgress)
+                                    if (index === 0 && productionContent.prod.in_progress)
                                         return productionContent.prod.product_type || "archer";
 
-                                    var queueIndex = productionContent.prod.inProgress ? index - 1 : index;
-                                    if (productionContent.prod.productionQueue && productionContent.prod.productionQueue[queueIndex])
-                                        return productionContent.prod.productionQueue[queueIndex];
+                                    var queueIndex = productionContent.prod.in_progress ? index - 1 : index;
+                                    if (productionContent.prod.production_queue && productionContent.prod.production_queue[queueIndex])
+                                        return productionContent.prod.production_queue[queueIndex];
 
                                     return "archer";
                                 }
@@ -189,7 +190,7 @@ Rectangle {
                     }
 
                     Text {
-                        property int queueTotal: (productionContent.prod.inProgress ? 1 : 0) + (productionContent.prod.queueSize || 0)
+                        property int queueTotal: (productionContent.prod.in_progress ? 1 : 0) + (productionContent.prod.queue_size || 0)
 
                         anchors.horizontalCenter: parent.horizontalCenter
                         text: queueTotal + " / 5"
@@ -206,7 +207,7 @@ Rectangle {
                         color: "#0a0f14"
                         border.color: "#2c3e50"
                         border.width: 2
-                        visible: productionContent.prod.inProgress
+                        visible: productionContent.prod.in_progress
 
                         Rectangle {
                             anchors.left: parent.left
@@ -214,10 +215,10 @@ Rectangle {
                             anchors.margins: 2
                             height: parent.height - 4
                             width: {
-                                if (!productionContent.prod.inProgress || productionContent.prod.buildTime <= 0)
+                                if (!productionContent.prod.in_progress || productionContent.prod.build_time <= 0)
                                     return 0;
 
-                                var progress = 1 - (Math.max(0, productionContent.prod.timeRemaining) / productionContent.prod.buildTime);
+                                var progress = 1 - (Math.max(0, productionContent.prod.time_remaining) / productionContent.prod.build_time);
                                 return Math.max(0, (parent.width - 4) * progress);
                             }
                             color: "#27ae60"
@@ -245,7 +246,7 @@ Rectangle {
 
                         Text {
                             anchors.centerIn: parent
-                            text: productionContent.prod.inProgress ? Math.max(0, productionContent.prod.timeRemaining).toFixed(1) + "s" : "Idle"
+                            text: productionContent.prod.in_progress ? Math.max(0, productionContent.prod.time_remaining).toFixed(1) + "s" : "Idle"
                             color: "#ecf0f1"
                             font.pointSize: 9
                             font.bold: true
@@ -257,8 +258,8 @@ Rectangle {
 
                     Text {
                         anchors.horizontalCenter: parent.horizontalCenter
-                        text: qsTr("Units Produced: %1 / %2").arg(productionContent.prod.producedCount || 0).arg(productionContent.prod.maxUnits || 0)
-                        color: (productionContent.prod.producedCount >= productionContent.prod.maxUnits) ? "#e74c3c" : "#bdc3c7"
+                        text: qsTr("Units Produced: %1 / %2").arg(productionContent.prod.produced_count || 0).arg(productionContent.prod.max_units || 0)
+                        color: (productionContent.prod.produced_count >= productionContent.prod.max_units) ? "#e74c3c" : "#bdc3c7"
                         font.pointSize: 8
                     }
 
@@ -267,7 +268,7 @@ Rectangle {
             }
 
             Rectangle {
-                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.hasSelectedType && productionPanel.gameInstance.hasSelectedType("barracks")))
+                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.has_selected_type && productionPanel.gameInstance.has_selected_type("barracks")))
 
                 width: parent.width
                 height: unitGridContent.height + 16
@@ -280,7 +281,7 @@ Rectangle {
                 Column {
                     id: unitGridContent
 
-                    property var prod: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.getSelectedProductionState) ? productionPanel.gameInstance.getSelectedProductionState() : productionPanel.defaultProductionState())
+                    property var prod: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.get_selected_production_state) ? productionPanel.gameInstance.get_selected_production_state() : productionPanel.defaultProductionState())
 
                     anchors.horizontalCenter: parent.horizontalCenter
                     anchors.top: parent.top
@@ -302,8 +303,8 @@ Rectangle {
                         rowSpacing: 8
 
                         Rectangle {
-                            property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
-                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
+                            property int queueTotal: (unitGridContent.prod.in_progress ? 1 : 0) + (unitGridContent.prod.queue_size || 0)
+                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.produced_count < unitGridContent.prod.max_units && queueTotal < 5
 
                             width: 110
                             height: 80
@@ -350,7 +351,7 @@ Rectangle {
                                     id: archerCostText
 
                                     anchors.centerIn: parent
-                                    text: unitGridContent.prod.villagerCost || 1
+                                    text: unitGridContent.prod.villager_cost || 1
                                     color: archerCostBadge.parent.isEnabled ? "#fdf7e3" : "#8a8a8a"
                                     font.pointSize: 16
                                     font.bold: true
@@ -367,7 +368,7 @@ Rectangle {
                                 onClicked: productionPanel.recruitUnit("archer")
                                 cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
                                 ToolTip.visible: containsMouse
-                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Archer\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
+                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Archer\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villager_cost || 1).arg((unitGridContent.prod.build_time || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.produced_count >= unitGridContent.prod.max_units ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
                                 ToolTip.delay: 300
                             }
 
@@ -381,8 +382,8 @@ Rectangle {
                         }
 
                         Rectangle {
-                            property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
-                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
+                            property int queueTotal: (unitGridContent.prod.in_progress ? 1 : 0) + (unitGridContent.prod.queue_size || 0)
+                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.produced_count < unitGridContent.prod.max_units && queueTotal < 5
 
                             width: 110
                             height: 80
@@ -429,7 +430,7 @@ Rectangle {
                                     id: swordsmanCostText
 
                                     anchors.centerIn: parent
-                                    text: unitGridContent.prod.villagerCost || 1
+                                    text: unitGridContent.prod.villager_cost || 1
                                     color: swordsmanCostBadge.parent.isEnabled ? "#fdf7e3" : "#8a8a8a"
                                     font.pointSize: 16
                                     font.bold: true
@@ -446,7 +447,7 @@ Rectangle {
                                 onClicked: productionPanel.recruitUnit("swordsman")
                                 cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
                                 ToolTip.visible: containsMouse
-                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Swordsman\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
+                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Swordsman\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villager_cost || 1).arg((unitGridContent.prod.build_time || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.produced_count >= unitGridContent.prod.max_units ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
                                 ToolTip.delay: 300
                             }
 
@@ -460,8 +461,8 @@ Rectangle {
                         }
 
                         Rectangle {
-                            property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
-                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
+                            property int queueTotal: (unitGridContent.prod.in_progress ? 1 : 0) + (unitGridContent.prod.queue_size || 0)
+                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.produced_count < unitGridContent.prod.max_units && queueTotal < 5
 
                             width: 110
                             height: 80
@@ -508,7 +509,7 @@ Rectangle {
                                     id: spearmanCostText
 
                                     anchors.centerIn: parent
-                                    text: unitGridContent.prod.villagerCost || 1
+                                    text: unitGridContent.prod.villager_cost || 1
                                     color: spearmanCostBadge.parent.isEnabled ? "#fdf7e3" : "#8a8a8a"
                                     font.pointSize: 16
                                     font.bold: true
@@ -525,7 +526,7 @@ Rectangle {
                                 onClicked: productionPanel.recruitUnit("spearman")
                                 cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
                                 ToolTip.visible: containsMouse
-                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Spearman\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
+                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Spearman\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villager_cost || 1).arg((unitGridContent.prod.build_time || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.produced_count >= unitGridContent.prod.max_units ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
                                 ToolTip.delay: 300
                             }
 
@@ -539,8 +540,8 @@ Rectangle {
                         }
 
                         Rectangle {
-                            property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
-                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
+                            property int queueTotal: (unitGridContent.prod.in_progress ? 1 : 0) + (unitGridContent.prod.queue_size || 0)
+                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.produced_count < unitGridContent.prod.max_units && queueTotal < 5
 
                             width: 110
                             height: 80
@@ -587,7 +588,7 @@ Rectangle {
                                     id: horseKnightCostText
 
                                     anchors.centerIn: parent
-                                    text: unitGridContent.prod.villagerCost || 1
+                                    text: unitGridContent.prod.villager_cost || 1
                                     color: horseKnightCostBadge.parent.isEnabled ? "#fdf7e3" : "#8a8a8a"
                                     font.pointSize: 16
                                     font.bold: true
@@ -604,7 +605,7 @@ Rectangle {
                                 onClicked: productionPanel.recruitUnit("horse_swordsman")
                                 cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
                                 ToolTip.visible: containsMouse
-                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Mounted Knight\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
+                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Mounted Knight\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villager_cost || 1).arg((unitGridContent.prod.build_time || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.produced_count >= unitGridContent.prod.max_units ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
                                 ToolTip.delay: 300
                             }
 
@@ -618,8 +619,8 @@ Rectangle {
                         }
 
                         Rectangle {
-                            property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
-                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
+                            property int queueTotal: (unitGridContent.prod.in_progress ? 1 : 0) + (unitGridContent.prod.queue_size || 0)
+                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.produced_count < unitGridContent.prod.max_units && queueTotal < 5
 
                             width: 110
                             height: 80
@@ -666,7 +667,7 @@ Rectangle {
                                     id: horseArcherCostText
 
                                     anchors.centerIn: parent
-                                    text: unitGridContent.prod.villagerCost || 1
+                                    text: unitGridContent.prod.villager_cost || 1
                                     color: horseArcherCostBadge.parent.isEnabled ? "#fdf7e3" : "#8a8a8a"
                                     font.pointSize: 16
                                     font.bold: true
@@ -683,7 +684,7 @@ Rectangle {
                                 onClicked: productionPanel.recruitUnit("horse_archer")
                                 cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
                                 ToolTip.visible: containsMouse
-                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Horse Archer\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
+                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Horse Archer\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villager_cost || 1).arg((unitGridContent.prod.build_time || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.produced_count >= unitGridContent.prod.max_units ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
                                 ToolTip.delay: 300
                             }
 
@@ -697,8 +698,8 @@ Rectangle {
                         }
 
                         Rectangle {
-                            property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
-                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
+                            property int queueTotal: (unitGridContent.prod.in_progress ? 1 : 0) + (unitGridContent.prod.queue_size || 0)
+                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.produced_count < unitGridContent.prod.max_units && queueTotal < 5
 
                             width: 110
                             height: 80
@@ -745,7 +746,7 @@ Rectangle {
                                     id: horseSpearmanCostText
 
                                     anchors.centerIn: parent
-                                    text: unitGridContent.prod.villagerCost || 1
+                                    text: unitGridContent.prod.villager_cost || 1
                                     color: horseSpearmanCostBadge.parent.isEnabled ? "#fdf7e3" : "#8a8a8a"
                                     font.pointSize: 16
                                     font.bold: true
@@ -762,7 +763,7 @@ Rectangle {
                                 onClicked: productionPanel.recruitUnit("horse_spearman")
                                 cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
                                 ToolTip.visible: containsMouse
-                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Horse Spearman\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
+                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Horse Spearman\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villager_cost || 1).arg((unitGridContent.prod.build_time || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.produced_count >= unitGridContent.prod.max_units ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
                                 ToolTip.delay: 300
                             }
 
@@ -776,8 +777,8 @@ Rectangle {
                         }
 
                         Rectangle {
-                            property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
-                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
+                            property int queueTotal: (unitGridContent.prod.in_progress ? 1 : 0) + (unitGridContent.prod.queue_size || 0)
+                            property bool isEnabled: unitGridContent.prod.has_barracks && unitGridContent.prod.produced_count < unitGridContent.prod.max_units && queueTotal < 5
 
                             width: 110
                             height: 80
@@ -836,7 +837,7 @@ Rectangle {
                                     }
 
                                     Text {
-                                        text: unitGridContent.prod.villagerCost || 1
+                                        text: unitGridContent.prod.villager_cost || 1
                                         color: parent.parent.parent.parent.isEnabled ? "#f39c12" : "#5a5a5a"
                                         font.pointSize: 9
                                         font.bold: true
@@ -855,7 +856,7 @@ Rectangle {
                                 onClicked: productionPanel.recruitUnit("healer")
                                 cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
                                 ToolTip.visible: containsMouse
-                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Healer\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
+                                ToolTip.text: parent.isEnabled ? qsTr("Recruit Healer\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villager_cost || 1).arg((unitGridContent.prod.build_time || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.produced_count >= unitGridContent.prod.max_units ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
                                 ToolTip.delay: 300
                             }
 
@@ -875,7 +876,7 @@ Rectangle {
             }
 
             Rectangle {
-                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.hasSelectedType && productionPanel.gameInstance.hasSelectedType("barracks")))
+                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.has_selected_type && productionPanel.gameInstance.has_selected_type("barracks")))
 
                 width: parent.width
                 height: 1
@@ -884,7 +885,7 @@ Rectangle {
             }
 
             Rectangle {
-                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.hasSelectedType && productionPanel.gameInstance.hasSelectedType("barracks")))
+                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.has_selected_type && productionPanel.gameInstance.has_selected_type("barracks")))
 
                 width: parent.width
                 height: rallyContent.height + 12
@@ -897,7 +898,7 @@ Rectangle {
                 Column {
                     id: rallyContent
 
-                    property var prod: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.getSelectedProductionState) ? productionPanel.gameInstance.getSelectedProductionState() : productionPanel.defaultProductionState())
+                    property var prod: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.get_selected_production_state) ? productionPanel.gameInstance.get_selected_production_state() : productionPanel.defaultProductionState())
 
                     anchors.horizontalCenter: parent.horizontalCenter
                     anchors.top: parent.top
@@ -947,14 +948,14 @@ Rectangle {
             }
 
             Item {
-                property bool has_barracksSelected: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.hasSelectedType && productionPanel.gameInstance.hasSelectedType("barracks")))
+                property bool has_barracksSelected: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.has_selected_type && productionPanel.gameInstance.has_selected_type("barracks")))
 
                 height: 20
                 visible: !has_barracksSelected
             }
 
             Item {
-                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.hasSelectedType && productionPanel.gameInstance.hasSelectedType("barracks")))
+                property bool has_barracks: (productionPanel.selectionTick, (productionPanel.gameInstance && productionPanel.gameInstance.has_selected_type && productionPanel.gameInstance.has_selected_type("barracks")))
 
                 visible: !has_barracks
                 width: parent.width

+ 1 - 1
ui/qml/SaveGamePanel.qml

@@ -34,7 +34,7 @@ Item {
     }
 
     Connections {
-        function onSaveSlotsChanged() {
+        function onSave_slots_changed() {
             if (typeof saveListModel !== 'undefined')
                 saveListModel.loadFromGame();