clang-tidy
This commit is contained in:
@@ -283,7 +283,7 @@ void Game::updateGameStateGameOver() {
|
||||
cleanVectors();
|
||||
|
||||
if (game_over_counter_ > 0) {
|
||||
if (game_over_counter_ == GAME_OVER_COUNTER_) {
|
||||
if (game_over_counter_ == GAME_OVER_COUNTER) {
|
||||
createMessage({paths_.at(2), paths_.at(3)}, Resource::get()->getTexture("game_text_game_over"));
|
||||
Audio::get()->fadeOutMusic(1000);
|
||||
balloon_manager_->setBouncingSounds(true);
|
||||
@@ -367,7 +367,7 @@ void Game::updateGameStateCompleted() {
|
||||
if (game_completed_counter_ == END_CELEBRATIONS) {
|
||||
for (auto &player : players_) {
|
||||
if (player->isCelebrating()) {
|
||||
player->setPlayingState(player->IsEligibleForHighScore() ? PlayerState::ENTERING_NAME_GAME_COMPLETED : PlayerState::LEAVING_SCREEN);
|
||||
player->setPlayingState(player->isEligibleForHighScore() ? PlayerState::ENTERING_NAME_GAME_COMPLETED : PlayerState::LEAVING_SCREEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -621,7 +621,7 @@ ItemType Game::dropItem() {
|
||||
break;
|
||||
case 4:
|
||||
if (LUCKY_NUMBER < helper_.item_coffee_odds) {
|
||||
helper_.item_coffee_odds = ITEM_COFFEE_ODDS_;
|
||||
helper_.item_coffee_odds = ITEM_COFFEE_ODDS;
|
||||
return ItemType::COFFEE;
|
||||
} else {
|
||||
if (helper_.need_coffee) {
|
||||
@@ -631,7 +631,7 @@ ItemType Game::dropItem() {
|
||||
break;
|
||||
case 5:
|
||||
if (LUCKY_NUMBER < helper_.item_coffee_machine_odds) {
|
||||
helper_.item_coffee_machine_odds = ITEM_COFFEE_MACHINE_ODDS_;
|
||||
helper_.item_coffee_machine_odds = ITEM_COFFEE_MACHINE_ODDS;
|
||||
if (!coffee_machine_enabled_ && helper_.need_coffee_machine) {
|
||||
return ItemType::COFFEE_MACHINE;
|
||||
}
|
||||
@@ -786,7 +786,7 @@ void Game::handlePlayerCollision(std::shared_ptr<Player> &player) {
|
||||
screen_->shake();
|
||||
playSound("voice_no.wav");
|
||||
player->setPlayingState(PlayerState::ROLLING);
|
||||
players_to_reorder.push_back(player);
|
||||
players_to_reorder_.push_back(player);
|
||||
if (allPlayersAreNotPlaying()) {
|
||||
// No se puede subir poder de fase si no hay nadie jugando
|
||||
Stage::power_can_be_added = false;
|
||||
@@ -928,7 +928,7 @@ void Game::render() {
|
||||
void Game::enableTimeStopItem() {
|
||||
balloon_manager_->stopAllBalloons();
|
||||
balloon_manager_->reverseColorsToAllBalloons();
|
||||
time_stopped_counter_ = TIME_STOPPED_COUNTER_;
|
||||
time_stopped_counter_ = TIME_STOPPED_COUNTER;
|
||||
}
|
||||
|
||||
// Deshabilita el efecto del item de detener el tiempo
|
||||
@@ -1158,12 +1158,12 @@ void Game::checkInput() {
|
||||
// Comprueba las entradas si no está el menú de servicio activo
|
||||
if (!ServiceMenu::get()->isEnabled()) {
|
||||
checkPauseInput();
|
||||
demo_.enabled ? DEMO_handlePassInput() : handlePlayersInput();
|
||||
demo_.enabled ? demoHandlePassInput() : handlePlayersInput();
|
||||
}
|
||||
|
||||
// Mueve los jugadores en el modo demo
|
||||
if (demo_.enabled) {
|
||||
DEMO_handleInput();
|
||||
demoHandleInput();
|
||||
}
|
||||
|
||||
// Verifica los inputs globales.
|
||||
@@ -1188,7 +1188,7 @@ void Game::checkPauseInput() {
|
||||
}
|
||||
|
||||
// Gestiona las entradas de los jugadores en el modo demo para saltarse la demo.
|
||||
void Game::DEMO_handlePassInput() {
|
||||
void Game::demoHandlePassInput() {
|
||||
if (input_->checkAnyButton()) {
|
||||
Section::name = Section::Name::TITLE; // Salir del modo demo y regresar al menú principal.
|
||||
Section::attract_mode = Section::AttractMode::TITLE_TO_DEMO; // El juego volverá a mostrar la demo
|
||||
@@ -1197,19 +1197,19 @@ void Game::DEMO_handlePassInput() {
|
||||
}
|
||||
|
||||
// Gestiona las entradas de los jugadores en el modo demo, incluyendo movimientos y disparos automáticos.
|
||||
void Game::DEMO_handleInput() {
|
||||
void Game::demoHandleInput() {
|
||||
int index = 0;
|
||||
for (const auto &player : players_) {
|
||||
if (player->isPlaying()) {
|
||||
// Maneja el input específico del jugador en modo demo.
|
||||
DEMO_handlePlayerInput(player, index);
|
||||
demoHandlePlayerInput(player, index);
|
||||
}
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
// Procesa las entradas para un jugador específico durante el modo demo.
|
||||
void Game::DEMO_handlePlayerInput(const std::shared_ptr<Player> &player, int index) {
|
||||
void Game::demoHandlePlayerInput(const std::shared_ptr<Player> &player, int index) {
|
||||
const auto &demo_data = demo_.data[index][demo_.counter];
|
||||
|
||||
if (demo_data.left == 1) {
|
||||
@@ -1721,10 +1721,10 @@ void Game::playSound(const std::string &name) {
|
||||
|
||||
// Organiza los jugadores para que los vivos se pinten sobre los muertos
|
||||
void Game::movePlayersToFront() {
|
||||
if (players_to_reorder.empty())
|
||||
if (players_to_reorder_.empty())
|
||||
return;
|
||||
|
||||
for (auto &player : players_to_reorder) {
|
||||
for (auto &player : players_to_reorder_) {
|
||||
auto it = std::find(players_.begin(), players_.end(), player);
|
||||
if (it != players_.end() && it != players_.begin()) {
|
||||
std::shared_ptr<Player> dying_player = *it;
|
||||
@@ -1732,7 +1732,7 @@ void Game::movePlayersToFront() {
|
||||
players_.insert(players_.begin(), dying_player);
|
||||
}
|
||||
}
|
||||
players_to_reorder.clear();
|
||||
players_to_reorder_.clear();
|
||||
}
|
||||
|
||||
// Comprueba si está activo el menu de servicio para poner el juego en pausa
|
||||
|
||||
Reference in New Issue
Block a user