From 578cf499063cc97bfb793e7e42443ec95d9e985f Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Wed, 16 Jun 2021 13:11:44 +0200 Subject: [PATCH] fix indentation --- sources/Runner/HowToPlayScene.cpp | 42 ++++----- sources/Runner/LobbyScene.cpp | 136 +++++++++++++++--------------- 2 files changed, 89 insertions(+), 89 deletions(-) diff --git a/sources/Runner/HowToPlayScene.cpp b/sources/Runner/HowToPlayScene.cpp index 434c5d7c..cfb2cb7e 100644 --- a/sources/Runner/HowToPlayScene.cpp +++ b/sources/Runner/HowToPlayScene.cpp @@ -18,64 +18,64 @@ namespace BBM std::shared_ptr Runner::loadHowToPlayScene() { auto scene = std::make_shared(); - static const std::map sounds = { + static const std::map sounds = { {SoundComponent::JUMP, "assets/sounds/click.ogg"} }; - addMenuControl(*scene); + addMenuControl(*scene); scene->addEntity("Control entity") .addComponent("assets/musics/music_player_select.ogg") .addComponent(sounds); scene->addEntity("background") .addComponent() .addComponent("assets/plain_menu_background.png"); - scene->addEntity("scene title text") + scene->addEntity("scene title text") .addComponent(1920 / 3, 100, 0) .addComponent("How To Play?", 120, RAY::Vector2(), ORANGE); - - scene->addEntity("select text") + + scene->addEntity("select text") .addComponent(1920 / 8, 1080 / 3, 0) .addComponent("Select:", 60, RAY::Vector2(), ORANGE); - scene->addEntity("select") + scene->addEntity("select") .addComponent(1920 / 7, 1080 / 2.5, 0) .addComponent("Space/A Button", 35, RAY::Vector2(), BLACK); - scene->addEntity("change skin text") + scene->addEntity("change skin text") .addComponent(1920 / 8, 1080 / 2, 0) .addComponent("Change Skin/Drop Bomb:", 60, RAY::Vector2(), ORANGE); - scene->addEntity("change skin") + scene->addEntity("change skin") .addComponent(1920 / 7, 1080 / 1.75, 0) .addComponent("E/B Button", 35, RAY::Vector2(), BLACK); - scene->addEntity("move text") + scene->addEntity("move text") .addComponent(1920 / 1.75, 1080 / 3, 0) .addComponent("Move:", 60, RAY::Vector2(), ORANGE); - scene->addEntity("move") + scene->addEntity("move") .addComponent(1920 / 1.75, 1080 / 2.5, 0) .addComponent("Q-Z-S-D/Arrow/Joystick", 35, RAY::Vector2(), BLACK); - scene->addEntity("back text") + scene->addEntity("back text") .addComponent(1920 / 1.75, 1080 / 2, 0) .addComponent("Back/Pause:", 60, RAY::Vector2(), ORANGE); - scene->addEntity("back") + scene->addEntity("back") .addComponent(1920 / 1.75, 1080 / 1.75, 0) .addComponent("Esc / Controller's Home button:", 35, RAY::Vector2(), BLACK); - auto &back = scene->addEntity("back to menu") + auto &back = scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") .addComponent([](WAL::Entity &entity, WAL::Wal &) { - gameState.nextScene = BBM::GameState::SceneID::LobbyScene; + gameState.nextScene = BBM::GameState::SceneID::LobbyScene; }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + { + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_back.png"); + texture->use("assets/buttons/button_back.png"); }) .addComponent([](WAL::Entity &entity, WAL::Wal &) { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); texture->use("assets/buttons/button_back_hovered.png"); - }); - return scene; - } + }); + return scene; + } } \ No newline at end of file diff --git a/sources/Runner/LobbyScene.cpp b/sources/Runner/LobbyScene.cpp index 139a663a..d898e6a8 100644 --- a/sources/Runner/LobbyScene.cpp +++ b/sources/Runner/LobbyScene.cpp @@ -44,63 +44,63 @@ namespace BBM .addComponent(1920 / 2.75, 100, 0) .addComponent("Get Ready", 120, RAY::Vector2(), ORANGE); auto &play = scene->addEntity("play button") - .addComponent(1920 / 2.5, 1080 - 180, 0) - .addComponent("assets/buttons/button_new_game.png") - .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - auto *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_new_game.png"); - }) - .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - auto *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_new_game_hovered.png"); - }) - .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - if (Runner::gameState.currentScene != GameState::LobbyScene - || !LobbySystem::playersAreReady(*wal.getScene())) - return; - LobbySystem::switchToGame(wal); - }) - .addComponent>(); + .addComponent(1920 / 2.5, 1080 - 180, 0) + .addComponent("assets/buttons/button_new_game.png") + .addComponent([](WAL::Entity &entity, WAL::Wal &wal) + { + auto *texture = dynamic_cast(entity.getComponent().drawable.get()); + texture->use("assets/buttons/button_new_game.png"); + }) + .addComponent([](WAL::Entity &entity, WAL::Wal &wal) + { + auto *texture = dynamic_cast(entity.getComponent().drawable.get()); + texture->use("assets/buttons/button_new_game_hovered.png"); + }) + .addComponent([](WAL::Entity &entity, WAL::Wal &wal) + { + if (Runner::gameState.currentScene != GameState::LobbyScene + || !LobbySystem::playersAreReady(*wal.getScene())) + return; + LobbySystem::switchToGame(wal); + }) + .addComponent>(); auto &back = scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - gameState.nextScene = BBM::GameState::SceneID::MainMenuScene; - }) + { + gameState.nextScene = BBM::GameState::SceneID::MainMenuScene; + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + { + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_back.png"); - }) + texture->use("assets/buttons/button_back.png"); + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + { + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_back_hovered.png"); - }); + texture->use("assets/buttons/button_back_hovered.png"); + }); auto &howToPlay = scene->addEntity("to to play") .addComponent(1920 - 10 - 75, 1080 - 85, 0) .addComponent("assets/buttons/button_htp.png") .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - gameState.nextScene = BBM::GameState::SceneID::HowToPlayScene; - }) + { + gameState.nextScene = BBM::GameState::SceneID::HowToPlayScene; + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) { RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); - texture->use("assets/buttons/button_htp.png"); + texture->use("assets/buttons/button_htp.png"); }) .addComponent([](WAL::Entity &entity, WAL::Wal &) { - RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); texture->use("assets/buttons/button_htp_hovered.png"); }); @@ -108,49 +108,49 @@ namespace BBM .addComponent(1920 / 6, 2 * 1080 / 3, 0) .addComponent("Lava: Off", 70, RAY::Vector2(), BLACK) .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - RAY2D::Text *text = dynamic_cast(entity.getComponent().drawable.get()); + { + RAY2D::Text *text = dynamic_cast(entity.getComponent().drawable.get()); - if (text->getString().find("Off") != std::string::npos) { - text->setText("Lava: On"); - //do - } else { - text->setText("Lava: Off"); - //do - } - }) + if (text->getString().find("Off") != std::string::npos) { + text->setText("Lava: On"); + //do + } else { + text->setText("Lava: Off"); + //do + } + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - entity.getComponent().drawable->setColor(BLACK); - }) + { + entity.getComponent().drawable->setColor(BLACK); + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - entity.getComponent().drawable->setColor(ORANGE); - }); + { + entity.getComponent().drawable->setColor(ORANGE); + }); auto &heightOption = scene->addEntity("Height option text") .addComponent(1920 / 1.75, 2 * 1080 / 3, 0) .addComponent("2nd Level: Off", 70, RAY::Vector2(), BLACK) .addComponent([](WAL::Entity &entity, WAL::Wal &wal) - { - RAY2D::Text *text = dynamic_cast(entity.getComponent().drawable.get()); + { + RAY2D::Text *text = dynamic_cast(entity.getComponent().drawable.get()); - if (text->getString().find("Off") != std::string::npos) { - text->setText("2nd Level: On"); - //do - } else { - text->setText("2nd Level: Off"); - //do - } - }) + if (text->getString().find("Off") != std::string::npos) { + text->setText("2nd Level: On"); + //do + } else { + text->setText("2nd Level: Off"); + //do + } + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - entity.getComponent().drawable->setColor(BLACK); - }) + { + entity.getComponent().drawable->setColor(BLACK); + }) .addComponent([](WAL::Entity &entity, WAL::Wal &) - { - entity.getComponent().drawable->setColor(ORANGE); - }); + { + entity.getComponent().drawable->setColor(ORANGE); + }); for (int i = 0; i < 4; i++) { auto &playerTile = scene->addEntity("player tile")