clang-tidy readability-function-cognitive-complexity
clang-format
This commit is contained in:
@@ -12,56 +12,56 @@ constexpr int NUMBER_OF_STAGES = 10;
|
||||
|
||||
// --- Estructuras de datos ---
|
||||
struct BalloonFormationParams {
|
||||
int x = 0; // Posición en el eje X donde crear el globo
|
||||
int y = 0; // Posición en el eje Y donde crear el globo
|
||||
float vel_x = 0.0F; // Velocidad inicial en el eje X
|
||||
BalloonType type = BalloonType::BALLOON; // Tipo de globo
|
||||
BalloonSize size = BalloonSize::SIZE1; // Tamaño de globo
|
||||
int creation_counter = 0; // Temporizador para la creación del globo
|
||||
int x = 0; // Posición en el eje X donde crear el globo
|
||||
int y = 0; // Posición en el eje Y donde crear el globo
|
||||
float vel_x = 0.0F; // Velocidad inicial en el eje X
|
||||
BalloonType type = BalloonType::BALLOON; // Tipo de globo
|
||||
BalloonSize size = BalloonSize::SIZE1; // Tamaño de globo
|
||||
int creation_counter = 0; // Temporizador para la creación del globo
|
||||
|
||||
// Constructor por defecto
|
||||
BalloonFormationParams() = default;
|
||||
// Constructor por defecto
|
||||
BalloonFormationParams() = default;
|
||||
|
||||
// Constructor con parámetros
|
||||
BalloonFormationParams(int x_val, int y_val, float vel_x_val, BalloonType type_val, BalloonSize size_val, int creation_counter_val)
|
||||
: x(x_val), y(y_val), vel_x(vel_x_val), type(type_val), size(size_val), creation_counter(creation_counter_val) {}
|
||||
// Constructor con parámetros
|
||||
BalloonFormationParams(int x_val, int y_val, float vel_x_val, BalloonType type_val, BalloonSize size_val, int creation_counter_val)
|
||||
: x(x_val), y(y_val), vel_x(vel_x_val), type(type_val), size(size_val), creation_counter(creation_counter_val) {}
|
||||
};
|
||||
|
||||
struct BalloonFormationUnit {
|
||||
int number_of_balloons; // Cantidad de globos que forman la formación
|
||||
std::vector<BalloonFormationParams> init; // Vector con todas las inicializaciones de los globos de la formación
|
||||
int number_of_balloons; // Cantidad de globos que forman la formación
|
||||
std::vector<BalloonFormationParams> init; // Vector con todas las inicializaciones de los globos de la formación
|
||||
|
||||
// Constructor con parámetros
|
||||
BalloonFormationUnit(int num_balloons, const std::vector<BalloonFormationParams> &init_params)
|
||||
: number_of_balloons(num_balloons), init(init_params) {}
|
||||
// Constructor con parámetros
|
||||
BalloonFormationUnit(int num_balloons, const std::vector<BalloonFormationParams> &init_params)
|
||||
: number_of_balloons(num_balloons), init(init_params) {}
|
||||
|
||||
// Constructor por defecto
|
||||
BalloonFormationUnit() : number_of_balloons(0) {}
|
||||
// Constructor por defecto
|
||||
BalloonFormationUnit() : number_of_balloons(0) {}
|
||||
};
|
||||
|
||||
using BalloonFormationPool = std::vector<const BalloonFormationUnit *>;
|
||||
|
||||
// --- Clase BalloonFormations ---
|
||||
class BalloonFormations {
|
||||
public:
|
||||
// --- Constructor y destructor ---
|
||||
BalloonFormations() {
|
||||
initBalloonFormations();
|
||||
initBalloonFormationPools();
|
||||
}
|
||||
~BalloonFormations() = default;
|
||||
public:
|
||||
// --- Constructor y destructor ---
|
||||
BalloonFormations() {
|
||||
initBalloonFormations();
|
||||
initBalloonFormationPools();
|
||||
}
|
||||
~BalloonFormations() = default;
|
||||
|
||||
// --- Getters ---
|
||||
auto getPool(int pool) -> const BalloonFormationPool & { return balloon_formation_pool_.at(pool); }
|
||||
auto getSet(int pool, int set) -> const BalloonFormationUnit & { return *balloon_formation_pool_.at(pool).at(set); }
|
||||
[[nodiscard]] auto getSet(int set) const -> const BalloonFormationUnit & { return balloon_formation_.at(set); }
|
||||
// --- Getters ---
|
||||
auto getPool(int pool) -> const BalloonFormationPool & { return balloon_formation_pool_.at(pool); }
|
||||
auto getSet(int pool, int set) -> const BalloonFormationUnit & { return *balloon_formation_pool_.at(pool).at(set); }
|
||||
[[nodiscard]] auto getSet(int set) const -> const BalloonFormationUnit & { return balloon_formation_.at(set); }
|
||||
|
||||
private:
|
||||
// --- Datos ---
|
||||
std::vector<BalloonFormationUnit> balloon_formation_; // Vector con todas las formaciones enemigas
|
||||
std::vector<BalloonFormationPool> balloon_formation_pool_; // Conjuntos de formaciones enemigas
|
||||
private:
|
||||
// --- Datos ---
|
||||
std::vector<BalloonFormationUnit> balloon_formation_; // Vector con todas las formaciones enemigas
|
||||
std::vector<BalloonFormationPool> balloon_formation_pool_; // Conjuntos de formaciones enemigas
|
||||
|
||||
// --- Métodos internos de inicialización ---
|
||||
void initBalloonFormations();
|
||||
void initBalloonFormationPools();
|
||||
// --- Métodos internos de inicialización ---
|
||||
void initBalloonFormations();
|
||||
void initBalloonFormationPools();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user