tidy-fix automàtic (sense naming)

This commit is contained in:
2026-05-14 18:28:23 +02:00
parent 358e91ea30
commit b7a551c158
81 changed files with 1549 additions and 831 deletions
+29 -11
View File
@@ -54,7 +54,9 @@ void ModuleGame::tick(int delta_ms) {
// per la Draw() d'onEnter. Només el JD8_Flip del caller muta
// pixel_data segons la paleta que avança pas a pas.
fade_.tick(delta_ms);
if (fade_.done()) phase_ = Phase::Playing;
if (fade_.done()) {
phase_ = Phase::Playing;
}
break;
case Phase::Playing:
@@ -75,7 +77,9 @@ void ModuleGame::tick(int delta_ms) {
// mostraria l'estat post-Update del sprite (p.ex. el prota
// "tornant" davant la porta després d'haver eixit).
fade_.tick(delta_ms);
if (fade_.done()) phase_ = Phase::Done;
if (fade_.done()) {
phase_ = Phase::Done;
}
break;
case Phase::Done:
@@ -83,8 +87,10 @@ void ModuleGame::tick(int delta_ms) {
}
}
int ModuleGame::nextState() const {
if (JG_Quitting()) return -1;
auto ModuleGame::nextState() const -> int {
if (JG_Quitting()) {
return -1;
}
if (info::ctx.num_habitacio == 1 ||
info::ctx.num_piramide == 100 ||
info::ctx.num_piramide == 7) {
@@ -93,14 +99,16 @@ int ModuleGame::nextState() const {
return 0;
}
void ModuleGame::applyFinalTransitions() {
void ModuleGame::applyFinalTransitions() const {
if (this->final_ == 1) {
info::ctx.num_habitacio++;
if (info::ctx.num_habitacio == 6) {
info::ctx.num_habitacio = 1;
info::ctx.num_piramide++;
}
if (info::ctx.num_piramide == 6 && info::ctx.num_habitacio == 2) info::ctx.num_piramide++;
if (info::ctx.num_piramide == 6 && info::ctx.num_habitacio == 2) {
info::ctx.num_piramide++;
}
} else if (this->final_ == 2) {
info::ctx.num_piramide = 100;
}
@@ -112,8 +120,12 @@ void ModuleGame::Draw() {
this->mapa->draw();
this->marcador->draw();
this->sam->draw();
for (auto& m : this->momies) m->draw();
if (this->bola) this->bola->draw();
for (auto& m : this->momies) {
m->draw();
}
if (this->bola) {
this->bola->draw();
}
}
void ModuleGame::Update() {
@@ -123,14 +135,18 @@ void ModuleGame::Update() {
this->final_ = this->sam->update();
const auto erased = std::erase_if(this->momies, [](auto& m) { return m->update(); });
info::ctx.momies -= static_cast<int>(erased);
if (this->bola) this->bola->update();
if (this->bola) {
this->bola->update();
}
this->mapa->update();
if (this->mapa->novaMomia()) {
this->momies.emplace_back(std::make_unique<Momia>(this->gfx, true, 0, 0, this->sam.get()));
info::ctx.momies++;
}
if (JI_CheatActivated("reviu")) info::ctx.vida = 5;
if (JI_CheatActivated("reviu")) {
info::ctx.vida = 5;
}
if (JI_CheatActivated("alone")) {
this->momies.clear();
info::ctx.momies = 0;
@@ -157,7 +173,9 @@ void ModuleGame::iniciarMomies() {
} else {
info::ctx.momies++;
}
if (info::ctx.num_piramide == 6) info::ctx.momies = 8;
if (info::ctx.num_piramide == 6) {
info::ctx.momies = 8;
}
int x = 20;
int y = 170;