Lint: rename públicos al inglés + refactor cognitive-complexity + unused-includes
Identifier-naming: rename de métodos públicos y cross-file al inglés
(camelBack), traducción de campos y locales en el proceso (TitleShip,
StageManager, SpawnController, ShipAnimator, helpers de PlayArea, etc.).
Refactor por cognitive-complexity (>25): GameScene::draw (59→3) con 9
helpers de estado, PhysicsWorld::resolveBodyCollisions (35→5) extrayendo
resolveBodyPair, Options::load{Window,Physics,Audio}ConfigFromYaml
(32/49/57→5/2/3) con templates readField, TitleScene::update (68→4) con
5 sub-pasos por estado + handleSkipInput/handleStartInput +
triggerExitForJoinedPlayers, DebrisManager::explode (39→3) con
extractSegments/spawnDebris/applyAngularVelocity/applyVisualRotation.
use-anyofallof: bucles → std::ranges::any_of/all_of en Input,
ShipAnimator y SpawnController.
readability-static-accessed-through-instance: Director::run y
VectorText::getTextWidth/Height invocados por clase.
readability-convert-member-functions-to-static: ResourcePack::decryptData.
unused-includes: eliminación de <utility>, <cstdint>, <vector>,
<iostream>, defaults.hpp y otros no usados directamente en headers y
unidades de traducción. Restablecido core/defaults.hpp en title_scene.cpp
(falsa "unused" del header).
Bug fix: eliminado isActive() duplicado en Bullet (redeclaración tras
rename de esta_activa→isActive que chocaba con el override de Entity).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,7 @@ void ShipAnimator::draw() const {
|
||||
}
|
||||
|
||||
// Renderizar ship (perspectiva ya incorporada a la shape)
|
||||
Rendering::render_shape(
|
||||
Rendering::renderShape(
|
||||
renderer_,
|
||||
ship.shape,
|
||||
ship.current_position,
|
||||
@@ -73,7 +73,7 @@ void ShipAnimator::draw() const {
|
||||
}
|
||||
}
|
||||
|
||||
void ShipAnimator::start_entry_animation() {
|
||||
void ShipAnimator::startEntryAnimation() {
|
||||
using namespace Defaults::Title::Ships;
|
||||
|
||||
// Configurar ship P1 para l'animación de entrada
|
||||
@@ -91,7 +91,7 @@ void ShipAnimator::start_entry_animation() {
|
||||
ships_[1].current_scale = ships_[1].initial_scale;
|
||||
}
|
||||
|
||||
void ShipAnimator::trigger_exit_animation() {
|
||||
void ShipAnimator::triggerExitAnimation() {
|
||||
// Configurar ambdues naves para l'animación de salida
|
||||
for (auto& ship : ships_) {
|
||||
// Canviar state a EXITING
|
||||
@@ -106,7 +106,7 @@ void ShipAnimator::trigger_exit_animation() {
|
||||
}
|
||||
}
|
||||
|
||||
void ShipAnimator::skip_to_floating_state() {
|
||||
void ShipAnimator::skipToFloatingState() {
|
||||
// Posar ambdues naves directament en state FLOATING
|
||||
for (auto& ship : ships_) {
|
||||
ship.state = ShipState::FLOATING;
|
||||
@@ -122,17 +122,12 @@ void ShipAnimator::skip_to_floating_state() {
|
||||
}
|
||||
}
|
||||
|
||||
auto ShipAnimator::is_visible() const -> bool {
|
||||
auto ShipAnimator::isVisible() const -> bool {
|
||||
// Retorna true si almenys una ship es visible
|
||||
for (const auto& ship : ships_) {
|
||||
if (ship.visible) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return std::ranges::any_of(ships_, [](const TitleShip& ship) { return ship.visible; });
|
||||
}
|
||||
|
||||
void ShipAnimator::trigger_exit_animation_for_player(int player_id) {
|
||||
void ShipAnimator::triggerExitAnimationForPlayer(int player_id) {
|
||||
// Trobar la ship del player especificat
|
||||
for (auto& ship : ships_) {
|
||||
if (ship.player_id == player_id) {
|
||||
@@ -150,20 +145,15 @@ void ShipAnimator::trigger_exit_animation_for_player(int player_id) {
|
||||
}
|
||||
}
|
||||
|
||||
void ShipAnimator::set_visible(bool visible) {
|
||||
void ShipAnimator::setVisible(bool visible) {
|
||||
for (auto& ship : ships_) {
|
||||
ship.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
auto ShipAnimator::is_animation_complete() const -> bool {
|
||||
auto ShipAnimator::isAnimationComplete() const -> bool {
|
||||
// Comprovar si todas las naves són invisibles (han completat l'animación de salida)
|
||||
for (const auto& ship : ships_) {
|
||||
if (ship.visible) {
|
||||
return false; // Aún hay alguna ship visible
|
||||
}
|
||||
}
|
||||
return true; // Todas las naves són invisibles
|
||||
return std::ranges::all_of(ships_, [](const TitleShip& ship) { return !ship.visible; });
|
||||
}
|
||||
|
||||
// Métodos de animación (stubs)
|
||||
@@ -185,7 +175,7 @@ void ShipAnimator::updateEntering(TitleShip& ship, float delta_time) {
|
||||
float progress = std::min(1.0F, elapsed / ENTRY_DURATION);
|
||||
|
||||
// Aplicar easing (ease_out_quad per arribada suau)
|
||||
float eased_progress = Easing::ease_out_quad(progress);
|
||||
float eased_progress = Easing::easeOutQuad(progress);
|
||||
|
||||
// Lerp posición (inicial → objetivo)
|
||||
ship.current_position.x = Easing::lerp(ship.initial_position.x, ship.target_position.x, eased_progress);
|
||||
@@ -230,7 +220,7 @@ void ShipAnimator::updateExiting(TitleShip& ship, float delta_time) {
|
||||
float progress = std::min(1.0F, ship.state_time / EXIT_DURATION);
|
||||
|
||||
// Aplicar easing (ease_in_quad per aceleración hacia el point de fuga)
|
||||
float eased_progress = Easing::ease_in_quad(progress);
|
||||
float eased_progress = Easing::easeInQuad(progress);
|
||||
|
||||
// Vec2 de fuga (centro del starfield)
|
||||
constexpr Vec2 VANISHING_POINT{.x = VANISHING_POINT_X, .y = VANISHING_POINT_Y};
|
||||
@@ -258,7 +248,7 @@ void ShipAnimator::configureShipP1(TitleShip& ship) {
|
||||
ship.state_time = 0.0F;
|
||||
|
||||
// Posicions (clock 8, bottom-left)
|
||||
ship.target_position = {.x = P1_TARGET_X(), .y = P1_TARGET_Y()};
|
||||
ship.target_position = {.x = p1TargetX(), .y = p1TargetY()};
|
||||
|
||||
// Calcular posición inicial (fuera de pantalla)
|
||||
ship.initial_position = computeOffscreenPosition(CLOCK_8_ANGLE);
|
||||
@@ -293,7 +283,7 @@ void ShipAnimator::configureShipP2(TitleShip& ship) {
|
||||
ship.state_time = 0.0F;
|
||||
|
||||
// Posicions (clock 4, bottom-right)
|
||||
ship.target_position = {.x = P2_TARGET_X(), .y = P2_TARGET_Y()};
|
||||
ship.target_position = {.x = p2TargetX(), .y = p2TargetY()};
|
||||
|
||||
// Calcular posición inicial (fuera de pantalla)
|
||||
ship.initial_position = computeOffscreenPosition(CLOCK_4_ANGLE);
|
||||
|
||||
Reference in New Issue
Block a user