refactor(enemies): renombrar big_pentagon a orb i enemy_big_orb a enemy_orb

This commit is contained in:
JailDesigner committed 2026-05-26 18:09:29 +02:00
1 parent fbfacb825b
commit 164f58c883
9 files changed
+34 -34

No files matched your search

+5 -5
View File
@@ -17,11 +17,11 @@ class Ship;
// Tipo de enemy
enum class EnemyType : uint8_t {
PENTAGON = 0, // Pentágono esquivador (zigzag)
SQUARE = 1, // Square perseguidor (tracks ship)
PINWHEEL = 2, // Molinillo agresivo (rápido, girando)
STAR = 3, // Estrella de 5 puntes (clone visual de Pentagon, comportament zigzag)
BIG_PENTAGON = 4, // Pentàgon gegant tough (HP=10, chase lent — primer enemic HP>1)
PENTAGON = 0, // Pentágono esquivador (zigzag)
SQUARE = 1, // Square perseguidor (tracks ship)
PINWHEEL = 2, // Molinillo agresivo (rápido, girando)
STAR = 3, // Estrella de 5 puntes (clone visual de Pentagon, comportament zigzag)
ORB = 4, // Orb gegant tough (HP=10, chase lent — primer enemic HP>1)
};
// Forward declaration — EnemyConfig viu a enemy_config.hpp i s'inclou només a enemy.cpp.
+3 -3
View File
@@ -30,7 +30,7 @@ namespace {
if (s == "square") { return EnemyType::SQUARE; }
if (s == "pinwheel") { return EnemyType::PINWHEEL; }
if (s == "star") { return EnemyType::STAR; }
if (s == "big_pentagon") { return EnemyType::BIG_PENTAGON; }
if (s == "orb") { return EnemyType::ORB; }
return std::nullopt;
}
@@ -353,8 +353,8 @@ namespace {
out.movement.rotation_proximity_multiplier = legacy.rotation_proximity_multiplier;
out.movement.proximity_distance = legacy.proximity_distance;
break;
case EnemyType::BIG_PENTAGON:
// Sense legacy fallback: el YAML del big_pentagon ha de definir
case EnemyType::ORB:
// Sense legacy fallback: el YAML de l'orb ha de definir
// ai.movement explícitament. Default chase lent perquè el switch
// siga exhaustiu i no falli si algú omet el bloc ai.
out.movement.type = MovementType::CHASE;
+4 -4
View File
@@ -13,7 +13,7 @@ EnemyConfig EnemyRegistry::pentagon_config;
EnemyConfig EnemyRegistry::square_config;
EnemyConfig EnemyRegistry::pinwheel_config;
EnemyConfig EnemyRegistry::star_config;
EnemyConfig EnemyRegistry::big_pentagon_config;
EnemyConfig EnemyRegistry::orb_config;
bool EnemyRegistry::loaded = false;
namespace {
@@ -40,7 +40,7 @@ auto EnemyRegistry::loadAll() -> bool {
loadOne("square", EnemyType::SQUARE, square_config) &&
loadOne("pinwheel", EnemyType::PINWHEEL, pinwheel_config) &&
loadOne("star", EnemyType::STAR, star_config) &&
loadOne("big_pentagon", EnemyType::BIG_PENTAGON, big_pentagon_config);
loadOne("orb", EnemyType::ORB, orb_config);
loaded = OK;
if (OK) {
std::cout << "[EnemyRegistry] 5 configuracions d'enemic carregades.\n";
@@ -62,8 +62,8 @@ auto EnemyRegistry::get(EnemyType type) -> const EnemyConfig& {
return pinwheel_config;
case EnemyType::STAR:
return star_config;
case EnemyType::BIG_PENTAGON:
return big_pentagon_config;
case EnemyType::ORB:
return orb_config;
}
std::cerr << "[EnemyRegistry] FATAL: tipus desconegut\n";
std::exit(EXIT_FAILURE);
+1 -1
View File
@@ -27,6 +27,6 @@ class EnemyRegistry {
static EnemyConfig square_config;
static EnemyConfig pinwheel_config;
static EnemyConfig star_config;
static EnemyConfig big_pentagon_config;
static EnemyConfig orb_config;
static bool loaded;
};