clang-tidy readability-function-cognitive-complexity
clang-format
This commit is contained in:
@@ -13,16 +13,15 @@ Bullet::Bullet(float x, float y, BulletType bullet_type, bool powered, int owner
|
||||
pos_y_(y),
|
||||
bullet_type_(bullet_type),
|
||||
owner_(owner) {
|
||||
|
||||
vel_x_ = calculateVelocity(bullet_type_);
|
||||
sprite_->setCurrentAnimation(buildAnimationString(bullet_type_, powered));
|
||||
|
||||
|
||||
collider_.r = WIDTH / 2;
|
||||
shiftColliders();
|
||||
}
|
||||
|
||||
// Calcula la velocidad horizontal de la bala basada en su tipo
|
||||
float Bullet::calculateVelocity(BulletType bullet_type) {
|
||||
auto Bullet::calculateVelocity(BulletType bullet_type) -> float {
|
||||
switch (bullet_type) {
|
||||
case BulletType::LEFT:
|
||||
return VEL_X_LEFT;
|
||||
@@ -34,9 +33,9 @@ float Bullet::calculateVelocity(BulletType bullet_type) {
|
||||
}
|
||||
|
||||
// Construye el string de animación basado en el tipo de bala y si está potenciada
|
||||
std::string Bullet::buildAnimationString(BulletType bullet_type, bool powered) {
|
||||
auto Bullet::buildAnimationString(BulletType bullet_type, bool powered) -> std::string {
|
||||
std::string animation_string = powered ? "powered_" : "normal_";
|
||||
|
||||
|
||||
switch (bullet_type) {
|
||||
case BulletType::UP:
|
||||
animation_string += "up";
|
||||
@@ -50,7 +49,7 @@ std::string Bullet::buildAnimationString(BulletType bullet_type, bool powered) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return animation_string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user