r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
Menu.hpp
Go to the documentation of this file.
1///
2/// @file Menu.hpp
3/// @brief This file contains the menu scene
4/// @namespace cli
5///
6
7#pragma once
8
9#include <unordered_map>
10#include <vector>
11
13
14namespace cli
15{
16 ///
17 /// @class Menu
18 /// @brief Menu scene
19 /// @namespace cli
20 ///
21 class Menu final : public eng::AScene
22 {
23 public:
24 Menu(eng::id assignedId, const std::shared_ptr<eng::IRenderer> &renderer);
25 ~Menu() override = default;
26
27 Menu(const Menu &other) = delete;
28 Menu &operator=(const Menu &other) = delete;
29 Menu(Menu &&other) = delete;
30 Menu &operator=(Menu &&other) = delete;
31
32 void update(float dt, const eng::WindowSize &size) override;
33 void event(const eng::Event &event) override;
34
35 bool &playMusic() { return m_playMusic; }
36
37 std::function<void(const std::string &option)> onOptionSelected;
38
39 private:
40 std::unordered_map<eng::Key, bool> m_keysPressed;
41 const std::vector<std::string> m_menuOptions = {"Solo", "Multi", "Settings"};
42
44 float m_animationTime = 0.0f;
45 float m_titlePulseTime = 0.0f;
47
48 const std::vector<std::string> m_contributors = {"Elliot", "Arthur", "Moana", "Aaron"};
51 bool m_playMusic = false;
52 }; // class Menu
53} // namespace cli
Menu scene.
Definition Menu.hpp:22
bool & playMusic()
Definition Menu.hpp:35
Menu(eng::id assignedId, const std::shared_ptr< eng::IRenderer > &renderer)
Definition menu.cpp:7
void event(const eng::Event &event) override
Definition menu.cpp:165
std::unordered_map< eng::Key, bool > m_keysPressed
Definition Menu.hpp:40
ecs::Entity m_contributorsEntity
Definition Menu.hpp:49
bool m_playMusic
Definition Menu.hpp:51
Menu(Menu &&other)=delete
~Menu() override=default
Menu & operator=(Menu &&other)=delete
const std::vector< std::string > m_menuOptions
Definition Menu.hpp:41
ecs::Entity m_titleEntity
Definition Menu.hpp:46
float m_animationTime
Definition Menu.hpp:44
const std::vector< std::string > m_contributors
Definition Menu.hpp:48
float m_titlePulseTime
Definition Menu.hpp:45
Menu & operator=(const Menu &other)=delete
Menu(const Menu &other)=delete
void update(float dt, const eng::WindowSize &size) override
Definition menu.cpp:105
int m_selectedIndex
Definition Menu.hpp:43
std::function< void(const std::string &option)> onOptionSelected
Definition Menu.hpp:37
float m_contributorsOffset
Definition Menu.hpp:50
Abstract class for scene.
Definition IScene.hpp:52
This file contains the IScene class.
std::uint32_t Entity
Definition Entity.hpp:13
unsigned int id
Definition IScene.hpp:20