Bläddra i källkod

Convert camelCase methods and variables to snake_case in game module

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 1 vecka sedan
förälder
incheckning
455840f479

+ 1 - 1
app/controllers/action_vfx.cpp

@@ -37,7 +37,7 @@ void ActionVFX::spawnAttackArrow(Engine::Core::World *world,
 
 
   arrow_system->spawnArrow(above_target, target_pos,
   arrow_system->spawnArrow(above_target, target_pos,
                            QVector3D(1.0F, 0.2F, 0.2F),
                            QVector3D(1.0F, 0.2F, 0.2F),
-                           Game::GameConfig::instance().arrow().speedAttack);
+                           Game::GameConfig::instance().arrow().speed_attack);
 }
 }
 
 
 } // namespace App::Controllers
 } // namespace App::Controllers

+ 4 - 4
app/core/game_engine.cpp

@@ -432,7 +432,7 @@ void GameEngine::on_right_click(qreal sx, qreal sy) {
                                            hit)) {
                                            hit)) {
       auto targets = Game::Systems::FormationPlanner::spreadFormation(
       auto targets = Game::Systems::FormationPlanner::spreadFormation(
           int(sel.size()), hit,
           int(sel.size()), hit,
-          Game::GameConfig::instance().gameplay().formationSpacingDefault);
+          Game::GameConfig::instance().gameplay().formation_spacing_default);
       Game::Systems::CommandService::MoveOptions opts;
       Game::Systems::CommandService::MoveOptions opts;
       opts.group_move = sel.size() > 1;
       opts.group_move = sel.size() > 1;
       Game::Systems::CommandService::moveUnits(*m_world, sel, targets, opts);
       Game::Systems::CommandService::moveUnits(*m_world, sel, targets, opts);
@@ -1314,7 +1314,7 @@ void GameEngine::start_skirmish(const QString &map_path,
     m_level.cam_far = result.cam_far;
     m_level.cam_far = result.cam_far;
     m_level.max_troops_per_player = result.max_troops_per_player;
     m_level.max_troops_per_player = result.max_troops_per_player;
 
 
-    Game::GameConfig::instance().setMaxTroopsPerPlayer(
+    Game::GameConfig::instance().set_max_troops_per_player(
         result.max_troops_per_player);
         result.max_troops_per_player);
 
 
     if (m_victoryService) {
     if (m_victoryService) {
@@ -1334,8 +1334,8 @@ void GameEngine::start_skirmish(const QString &map_path,
 
 
     if (result.hasFocusPosition && m_camera) {
     if (result.hasFocusPosition && m_camera) {
       const auto &cam_config = Game::GameConfig::instance().camera();
       const auto &cam_config = Game::GameConfig::instance().camera();
-      m_camera->setRTSView(result.focusPosition, cam_config.defaultDistance,
-                           cam_config.defaultPitch, cam_config.defaultYaw);
+      m_camera->setRTSView(result.focusPosition, cam_config.default_distance,
+                           cam_config.default_pitch, cam_config.default_yaw);
     }
     }
 
 
     Game::Map::MapDefinition map_def;
     Game::Map::MapDefinition map_def;

+ 59 - 59
game/game_config.h

@@ -3,24 +3,24 @@
 namespace Game {
 namespace Game {
 
 
 struct CameraConfig {
 struct CameraConfig {
-  float defaultDistance = 12.0F;
-  float defaultPitch = 45.0F;
-  float defaultYaw = 225.0F;
-  float orbitStepNormal = 4.0F;
-  float orbitStepShift = 8.0F;
+  float default_distance = 12.0F;
+  float default_pitch = 45.0F;
+  float default_yaw = 225.0F;
+  float orbit_step_normal = 4.0F;
+  float orbit_step_shift = 8.0F;
 };
 };
 
 
 struct ArrowConfig {
 struct ArrowConfig {
-  float arcHeightMultiplier = 0.15F;
-  float arcHeightMin = 0.2F;
-  float arcHeightMax = 1.2F;
-  float speedDefault = 8.0F;
-  float speedAttack = 6.0F;
+  float arc_height_multiplier = 0.15F;
+  float arc_height_min = 0.2F;
+  float arc_height_max = 1.2F;
+  float speed_default = 8.0F;
+  float speed_attack = 6.0F;
 };
 };
 
 
 struct GameplayConfig {
 struct GameplayConfig {
   float visibility_update_interval = 0.075F;
   float visibility_update_interval = 0.075F;
-  float formationSpacingDefault = 1.0F;
+  float formation_spacing_default = 1.0F;
   int max_troops_per_player = 500;
   int max_troops_per_player = 500;
 };
 };
 
 
@@ -41,95 +41,95 @@ public:
     return m_gameplay;
     return m_gameplay;
   }
   }
 
 
-  [[nodiscard]] auto getCameraDefaultDistance() const noexcept -> float {
-    return m_camera.defaultDistance;
+  [[nodiscard]] auto get_camera_default_distance() const noexcept -> float {
+    return m_camera.default_distance;
   }
   }
-  [[nodiscard]] auto getCameraDefaultPitch() const noexcept -> float {
-    return m_camera.defaultPitch;
+  [[nodiscard]] auto get_camera_default_pitch() const noexcept -> float {
+    return m_camera.default_pitch;
   }
   }
-  [[nodiscard]] auto getCameraDefaultYaw() const noexcept -> float {
-    return m_camera.defaultYaw;
+  [[nodiscard]] auto get_camera_default_yaw() const noexcept -> float {
+    return m_camera.default_yaw;
   }
   }
 
 
-  [[nodiscard]] auto getArrowArcHeightMultiplier() const noexcept -> float {
-    return m_arrow.arcHeightMultiplier;
+  [[nodiscard]] auto get_arrow_arc_height_multiplier() const noexcept -> float {
+    return m_arrow.arc_height_multiplier;
   }
   }
-  [[nodiscard]] auto getArrowArcHeightMin() const noexcept -> float {
-    return m_arrow.arcHeightMin;
+  [[nodiscard]] auto get_arrow_arc_height_min() const noexcept -> float {
+    return m_arrow.arc_height_min;
   }
   }
-  [[nodiscard]] auto getArrowArcHeightMax() const noexcept -> float {
-    return m_arrow.arcHeightMax;
+  [[nodiscard]] auto get_arrow_arc_height_max() const noexcept -> float {
+    return m_arrow.arc_height_max;
   }
   }
 
 
-  [[nodiscard]] auto getArrowSpeedDefault() const noexcept -> float {
-    return m_arrow.speedDefault;
+  [[nodiscard]] auto get_arrow_speed_default() const noexcept -> float {
+    return m_arrow.speed_default;
   }
   }
-  [[nodiscard]] auto getArrowSpeedAttack() const noexcept -> float {
-    return m_arrow.speedAttack;
+  [[nodiscard]] auto get_arrow_speed_attack() const noexcept -> float {
+    return m_arrow.speed_attack;
   }
   }
 
 
-  [[nodiscard]] auto getVisibilityUpdateInterval() const noexcept -> float {
+  [[nodiscard]] auto get_visibility_update_interval() const noexcept -> float {
     return m_gameplay.visibility_update_interval;
     return m_gameplay.visibility_update_interval;
   }
   }
 
 
-  [[nodiscard]] auto getFormationSpacingDefault() const noexcept -> float {
-    return m_gameplay.formationSpacingDefault;
+  [[nodiscard]] auto get_formation_spacing_default() const noexcept -> float {
+    return m_gameplay.formation_spacing_default;
   }
   }
 
 
-  [[nodiscard]] auto getCameraOrbitStepNormal() const noexcept -> float {
-    return m_camera.orbitStepNormal;
+  [[nodiscard]] auto get_camera_orbit_step_normal() const noexcept -> float {
+    return m_camera.orbit_step_normal;
   }
   }
-  [[nodiscard]] auto getCameraOrbitStepShift() const noexcept -> float {
-    return m_camera.orbitStepShift;
+  [[nodiscard]] auto get_camera_orbit_step_shift() const noexcept -> float {
+    return m_camera.orbit_step_shift;
   }
   }
 
 
-  void setCameraDefaultDistance(float value) noexcept {
-    m_camera.defaultDistance = value;
+  void set_camera_default_distance(float value) noexcept {
+    m_camera.default_distance = value;
   }
   }
-  void setCameraDefaultPitch(float value) noexcept {
-    m_camera.defaultPitch = value;
+  void set_camera_default_pitch(float value) noexcept {
+    m_camera.default_pitch = value;
   }
   }
-  void setCameraDefaultYaw(float value) noexcept {
-    m_camera.defaultYaw = value;
+  void set_camera_default_yaw(float value) noexcept {
+    m_camera.default_yaw = value;
   }
   }
 
 
-  void setArrowArcHeightMultiplier(float value) noexcept {
-    m_arrow.arcHeightMultiplier = value;
+  void set_arrow_arc_height_multiplier(float value) noexcept {
+    m_arrow.arc_height_multiplier = value;
   }
   }
-  void setArrowArcHeightMin(float value) noexcept {
-    m_arrow.arcHeightMin = value;
+  void set_arrow_arc_height_min(float value) noexcept {
+    m_arrow.arc_height_min = value;
   }
   }
-  void setArrowArcHeightMax(float value) noexcept {
-    m_arrow.arcHeightMax = value;
+  void set_arrow_arc_height_max(float value) noexcept {
+    m_arrow.arc_height_max = value;
   }
   }
 
 
-  void setArrowSpeedDefault(float value) noexcept {
-    m_arrow.speedDefault = value;
+  void set_arrow_speed_default(float value) noexcept {
+    m_arrow.speed_default = value;
   }
   }
-  void setArrowSpeedAttack(float value) noexcept {
-    m_arrow.speedAttack = value;
+  void set_arrow_speed_attack(float value) noexcept {
+    m_arrow.speed_attack = value;
   }
   }
 
 
-  void setVisibilityUpdateInterval(float value) noexcept {
+  void set_visibility_update_interval(float value) noexcept {
     m_gameplay.visibility_update_interval = value;
     m_gameplay.visibility_update_interval = value;
   }
   }
 
 
-  void setFormationSpacingDefault(float value) noexcept {
-    m_gameplay.formationSpacingDefault = value;
+  void set_formation_spacing_default(float value) noexcept {
+    m_gameplay.formation_spacing_default = value;
   }
   }
 
 
-  void setCameraOrbitStepNormal(float value) noexcept {
-    m_camera.orbitStepNormal = value;
+  void set_camera_orbit_step_normal(float value) noexcept {
+    m_camera.orbit_step_normal = value;
   }
   }
-  void setCameraOrbitStepShift(float value) noexcept {
-    m_camera.orbitStepShift = value;
+  void set_camera_orbit_step_shift(float value) noexcept {
+    m_camera.orbit_step_shift = value;
   }
   }
 
 
-  [[nodiscard]] auto getMaxTroopsPerPlayer() const noexcept -> int {
+  [[nodiscard]] auto get_max_troops_per_player() const noexcept -> int {
     return m_gameplay.max_troops_per_player;
     return m_gameplay.max_troops_per_player;
   }
   }
 
 
-  void setMaxTroopsPerPlayer(int value) noexcept {
+  void set_max_troops_per_player(int value) noexcept {
     m_gameplay.max_troops_per_player = value;
     m_gameplay.max_troops_per_player = value;
   }
   }
 
 

+ 2 - 2
game/map/environment.cpp

@@ -25,8 +25,8 @@ void Environment::apply(const MapDefinition &def,
 void Environment::applyDefault(Render::GL::Renderer &renderer,
 void Environment::applyDefault(Render::GL::Renderer &renderer,
                                Render::GL::Camera &camera) {
                                Render::GL::Camera &camera) {
   const auto &camera_config = Game::GameConfig::instance().camera();
   const auto &camera_config = Game::GameConfig::instance().camera();
-  camera.setRTSView(QVector3D(0, 0, 0), 15.0F, camera_config.defaultPitch,
-                    camera_config.defaultYaw);
+  camera.setRTSView(QVector3D(0, 0, 0), 15.0F, camera_config.default_pitch,
+                    camera_config.default_yaw);
 
 
   camera.setPerspective(45.0F, 16.0F / 9.0F, 1.0F, 200.0F);
   camera.setPerspective(45.0F, 16.0F / 9.0F, 1.0F, 200.0F);
   Render::GL::Renderer::GridParams gp;
   Render::GL::Renderer::GridParams gp;

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

@@ -133,7 +133,7 @@ void AICommandApplier::apply(Engine::Core::World &world, int aiOwnerId,
       int const current_troops =
       int const current_troops =
           Engine::Core::World::count_troops_for_player(aiOwnerId);
           Engine::Core::World::count_troops_for_player(aiOwnerId);
       int const max_troops =
       int const max_troops =
-          Game::GameConfig::instance().getMaxTroopsPerPlayer();
+          Game::GameConfig::instance().get_max_troops_per_player();
       Game::Units::TroopType const product_type = production->product_type;
       Game::Units::TroopType const product_type = production->product_type;
       int const individuals_per_unit =
       int const individuals_per_unit =
           Game::Units::TroopConfig::instance().getIndividualsPerUnit(
           Game::Units::TroopConfig::instance().getIndividualsPerUnit(

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

@@ -41,7 +41,7 @@ void AIReasoner::updateContext(const AISnapshot &snapshot, AIContext &ctx) {
   ctx.enemyBuildingsCount = 0;
   ctx.enemyBuildingsCount = 0;
   ctx.averageEnemyDistance = 0.0F;
   ctx.averageEnemyDistance = 0.0F;
   ctx.max_troops_per_player =
   ctx.max_troops_per_player =
-      Game::GameConfig::instance().getMaxTroopsPerPlayer();
+      Game::GameConfig::instance().get_max_troops_per_player();
 
 
   constexpr float attack_record_timeout = 10.0F;
   constexpr float attack_record_timeout = 10.0F;
   auto it = ctx.buildingsUnderAttack.begin();
   auto it = ctx.buildingsUnderAttack.begin();

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

@@ -235,7 +235,7 @@ void DefendBehavior::execute(const AISnapshot &snapshot, AIContext &context,
   }
   }
 
 
   QVector3D const defend_pos(defend_pos_x, defend_pos_y, defend_pos_z);
   QVector3D const defend_pos(defend_pos_x, defend_pos_y, defend_pos_z);
-  auto targets = FormationSystem::instance().getFormationPositions(
+  auto targets = FormationSystem::instance().get_formation_positions(
       formation_type, static_cast<int>(unclaimed_defenders.size()), defend_pos,
       formation_type, static_cast<int>(unclaimed_defenders.size()), defend_pos,
       3.0F);
       3.0F);
 
 

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

@@ -61,7 +61,7 @@ void GatherBehavior::execute(const AISnapshot &snapshot, AIContext &context,
     formation_type = nation->formation_type;
     formation_type = nation->formation_type;
   }
   }
 
 
-  auto formation_targets = FormationSystem::instance().getFormationPositions(
+  auto formation_targets = FormationSystem::instance().get_formation_positions(
       formation_type, static_cast<int>(units_to_gather.size()), rally_point,
       formation_type, static_cast<int>(units_to_gather.size()), rally_point,
       1.4F);
       1.4F);
 
 

+ 2 - 2
game/systems/arrow_system.cpp

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

+ 3 - 3
game/systems/camera_service.cpp

@@ -57,7 +57,7 @@ void CameraService::orbit_direction(Render::GL::Camera &camera, int direction,
                                     bool shift) {
                                     bool shift) {
   const auto &cam_config = Game::GameConfig::instance().camera();
   const auto &cam_config = Game::GameConfig::instance().camera();
   float const step =
   float const step =
-      shift ? cam_config.orbitStepShift : cam_config.orbitStepNormal;
+      shift ? cam_config.orbit_step_shift : cam_config.orbit_step_normal;
   float const pitch = step * float(direction);
   float const pitch = step * float(direction);
   orbit(camera, 0.0F, pitch);
   orbit(camera, 0.0F, pitch);
 }
 }
@@ -114,8 +114,8 @@ void CameraService::snapToEntity(Render::GL::Camera &camera,
   if (auto *t = entity.get_component<Engine::Core::TransformComponent>()) {
   if (auto *t = entity.get_component<Engine::Core::TransformComponent>()) {
     QVector3D const center(t->position.x, t->position.y, t->position.z);
     QVector3D const center(t->position.x, t->position.y, t->position.z);
     const auto &cam_config = Game::GameConfig::instance().camera();
     const auto &cam_config = Game::GameConfig::instance().camera();
-    camera.setRTSView(center, cam_config.defaultDistance,
-                      cam_config.defaultPitch, cam_config.defaultYaw);
+    camera.setRTSView(center, cam_config.default_distance,
+                      cam_config.default_pitch, cam_config.default_yaw);
   }
   }
 }
 }
 
 

+ 2 - 2
game/systems/formation_system.cpp

@@ -99,7 +99,7 @@ void FormationSystem::initializeDefaults() {
                     std::make_unique<BarbarianFormation>());
                     std::make_unique<BarbarianFormation>());
 }
 }
 
 
-auto FormationSystem::getFormationPositions(
+auto FormationSystem::get_formation_positions(
     FormationType type, int unit_count, const QVector3D &center,
     FormationType type, int unit_count, const QVector3D &center,
     float base_spacing) -> std::vector<QVector3D> {
     float base_spacing) -> std::vector<QVector3D> {
   auto it = m_formations.find(type);
   auto it = m_formations.find(type);
@@ -117,7 +117,7 @@ void FormationSystem::registerFormation(FormationType type,
   m_formations[type] = std::move(formation);
   m_formations[type] = std::move(formation);
 }
 }
 
 
-auto FormationSystem::getFormation(FormationType type) const
+auto FormationSystem::get_formation(FormationType type) const
     -> const IFormation * {
     -> const IFormation * {
   auto it = m_formations.find(type);
   auto it = m_formations.find(type);
   if (it == m_formations.end()) {
   if (it == m_formations.end()) {

+ 2 - 2
game/systems/formation_system.h

@@ -60,14 +60,14 @@ public:
   static auto instance() -> FormationSystem &;
   static auto instance() -> FormationSystem &;
 
 
   auto
   auto
-  getFormationPositions(FormationType type, int unit_count,
+  get_formation_positions(FormationType type, int unit_count,
                         const QVector3D &center,
                         const QVector3D &center,
                         float base_spacing = 1.0F) -> std::vector<QVector3D>;
                         float base_spacing = 1.0F) -> std::vector<QVector3D>;
 
 
   void registerFormation(FormationType type,
   void registerFormation(FormationType type,
                          std::unique_ptr<IFormation> formation);
                          std::unique_ptr<IFormation> formation);
 
 
-  auto getFormation(FormationType type) const -> const IFormation *;
+  auto get_formation(FormationType type) const -> const IFormation *;
 
 
 private:
 private:
   FormationSystem();
   FormationSystem();

+ 3 - 3
game/systems/game_state_serializer.cpp

@@ -23,7 +23,7 @@ auto GameStateSerializer::buildMetadata(
   metadata["player_unit_id"] = static_cast<qint64>(level.player_unit_id);
   metadata["player_unit_id"] = static_cast<qint64>(level.player_unit_id);
 
 
   metadata["gameMaxTroopsPerPlayer"] =
   metadata["gameMaxTroopsPerPlayer"] =
-      Game::GameConfig::instance().getMaxTroopsPerPlayer();
+      Game::GameConfig::instance().get_max_troops_per_player();
 
 
   const auto &terrain_service = Game::Map::TerrainService::instance();
   const auto &terrain_service = Game::Map::TerrainService::instance();
   if (const auto *height_map = terrain_service.getHeightMap()) {
   if (const auto *height_map = terrain_service.getHeightMap()) {
@@ -145,10 +145,10 @@ void GameStateSerializer::restoreLevelFromMetadata(const QJsonObject &metadata,
   int max_troops = metadata.value("max_troops_per_player")
   int max_troops = metadata.value("max_troops_per_player")
                        .toInt(level.max_troops_per_player);
                        .toInt(level.max_troops_per_player);
   if (max_troops <= 0) {
   if (max_troops <= 0) {
-    max_troops = Game::GameConfig::instance().getMaxTroopsPerPlayer();
+    max_troops = Game::GameConfig::instance().get_max_troops_per_player();
   }
   }
   level.max_troops_per_player = max_troops;
   level.max_troops_per_player = max_troops;
-  Game::GameConfig::instance().setMaxTroopsPerPlayer(max_troops);
+  Game::GameConfig::instance().set_max_troops_per_player(max_troops);
 }
 }
 
 
 } // namespace Game::Systems
 } // namespace Game::Systems

+ 1 - 1
game/systems/production_service.cpp

@@ -85,7 +85,7 @@ auto ProductionService::startProductionForFirstSelectedBarracks(
 
 
   int const current_troops =
   int const current_troops =
       Engine::Core::World::count_troops_for_player(owner_id);
       Engine::Core::World::count_troops_for_player(owner_id);
-  int const max_troops = Game::GameConfig::instance().getMaxTroopsPerPlayer();
+  int const max_troops = Game::GameConfig::instance().get_max_troops_per_player();
   if (current_troops + production_cost > max_troops) {
   if (current_troops + production_cost > max_troops) {
     return ProductionResult::GlobalTroopLimitReached;
     return ProductionResult::GlobalTroopLimitReached;
   }
   }

+ 2 - 2
game/systems/production_system.cpp

@@ -82,7 +82,7 @@ void ProductionSystem::update(Engine::Core::World *world, float delta_time) {
         int const current_troops =
         int const current_troops =
             Engine::Core::World::count_troops_for_player(u->owner_id);
             Engine::Core::World::count_troops_for_player(u->owner_id);
         int const max_troops =
         int const max_troops =
-            Game::GameConfig::instance().getMaxTroopsPerPlayer();
+            Game::GameConfig::instance().get_max_troops_per_player();
         if (current_troops + production_cost > max_troops) {
         if (current_troops + production_cost > max_troops) {
           prod->in_progress = false;
           prod->in_progress = false;
           prod->time_remaining = 0.0F;
           prod->time_remaining = 0.0F;
@@ -108,7 +108,7 @@ void ProductionSystem::update(Engine::Core::World *world, float delta_time) {
           auto unit = reg->create(sp.spawn_type, *world, sp);
           auto unit = reg->create(sp.spawn_type, *world, sp);
 
 
           if (unit && prod->rally_set) {
           if (unit && prod->rally_set) {
-            unit->moveTo(prod->rally_x, prod->rally_z);
+            unit->move_to(prod->rally_x, prod->rally_z);
           }
           }
         }
         }
 
 

+ 5 - 5
game/systems/projectile_system.cpp

@@ -22,14 +22,14 @@ void ProjectileSystem::spawn_arrow(const QVector3D &start, const QVector3D &end,
   float arc_height;
   float arc_height;
   if (is_ballista_bolt) {
   if (is_ballista_bolt) {
 
 
-    arc_height = std::clamp(m_arrow_config.arcHeightMultiplier * dist * 0.4F,
-                            m_arrow_config.arcHeightMin * 0.5F,
-                            m_arrow_config.arcHeightMax * 0.6F);
+    arc_height = std::clamp(m_arrow_config.arc_height_multiplier * dist * 0.4F,
+                            m_arrow_config.arc_height_min * 0.5F,
+                            m_arrow_config.arc_height_max * 0.6F);
   } else {
   } else {
 
 
     arc_height =
     arc_height =
-        std::clamp(m_arrow_config.arcHeightMultiplier * dist,
-                   m_arrow_config.arcHeightMin, m_arrow_config.arcHeightMax);
+        std::clamp(m_arrow_config.arc_height_multiplier * dist,
+                   m_arrow_config.arc_height_min, m_arrow_config.arc_height_max);
   }
   }
   float inv_dist = (dist > 0.001F) ? (1.0F / dist) : 1.0F;
   float inv_dist = (dist > 0.001F) ? (1.0F / dist) : 1.0F;
 
 

+ 3 - 3
game/units/unit.cpp

@@ -50,7 +50,7 @@ void Unit::ensureCoreComponents() {
   }
   }
 }
 }
 
 
-void Unit::moveTo(float x, float z) {
+void Unit::move_to(float x, float z) {
   ensureCoreComponents();
   ensureCoreComponents();
   if (m_mv == nullptr) {
   if (m_mv == nullptr) {
     if (auto *e = entity()) {
     if (auto *e = entity()) {
@@ -94,7 +94,7 @@ auto Unit::position() const -> QVector3D {
   return {};
   return {};
 }
 }
 
 
-void Unit::setHoldMode(bool enabled) {
+void Unit::set_hold_mode(bool enabled) {
   auto *e = entity();
   auto *e = entity();
   if (e == nullptr) {
   if (e == nullptr) {
     return;
     return;
@@ -123,7 +123,7 @@ void Unit::setHoldMode(bool enabled) {
   }
   }
 }
 }
 
 
-auto Unit::isInHoldMode() const -> bool {
+auto Unit::is_in_hold_mode() const -> bool {
   auto *e = entity();
   auto *e = entity();
   if (e == nullptr) {
   if (e == nullptr) {
     return false;
     return false;

+ 3 - 3
game/units/unit.h

@@ -40,12 +40,12 @@ public:
     return m_type_string;
     return m_type_string;
   }
   }
 
 
-  void moveTo(float x, float z);
+  void move_to(float x, float z);
   [[nodiscard]] auto is_alive() const -> bool;
   [[nodiscard]] auto is_alive() const -> bool;
   [[nodiscard]] auto position() const -> QVector3D;
   [[nodiscard]] auto position() const -> QVector3D;
 
 
-  void setHoldMode(bool enabled);
-  [[nodiscard]] auto isInHoldMode() const -> bool;
+  void set_hold_mode(bool enabled);
+  [[nodiscard]] auto is_in_hold_mode() const -> bool;
 
 
 protected:
 protected:
   Unit(Engine::Core::World &world, TroopType type);
   Unit(Engine::Core::World &world, TroopType type);