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:
@@ -16,7 +16,7 @@ void detectBulletEnemy(Context& ctx) {
|
||||
|
||||
for (auto& bullet : ctx.bullets) {
|
||||
for (auto& enemy : ctx.enemies) {
|
||||
if (!Physics::check_collision(bullet, enemy, AMPLIFIER)) {
|
||||
if (!Physics::checkCollision(bullet, enemy, AMPLIFIER)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void detectShipEnemy(Context& ctx) {
|
||||
if (enemy.isInvulnerable()) {
|
||||
continue;
|
||||
}
|
||||
if (Physics::check_collision(ctx.ships[i], enemy, AMPLIFIER)) {
|
||||
if (Physics::checkCollision(ctx.ships[i], enemy, AMPLIFIER)) {
|
||||
ctx.on_player_hit(i);
|
||||
break; // Solo una colisión por player por frame
|
||||
}
|
||||
@@ -102,7 +102,7 @@ void detectBulletPlayer(Context& ctx) {
|
||||
constexpr float AMPLIFIER = Defaults::Game::COLLISION_BULLET_PLAYER_AMPLIFIER;
|
||||
|
||||
for (auto& bullet : ctx.bullets) {
|
||||
if (!bullet.esta_activa() || bullet.getGraceTimer() > 0.0F) {
|
||||
if (!bullet.isActive() || bullet.getGraceTimer() > 0.0F) {
|
||||
continue;
|
||||
}
|
||||
const uint8_t BULLET_OWNER = bullet.getOwnerId();
|
||||
@@ -120,7 +120,7 @@ void detectBulletPlayer(Context& ctx) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Physics::check_collision(bullet, ctx.ships[player_id], AMPLIFIER)) {
|
||||
if (!Physics::checkCollision(bullet, ctx.ships[player_id], AMPLIFIER)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user