Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
GamepadSettingsScene.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_CLIENT_SCENES_GAMEPADSETTINGSSCENE_HPP_
9 #define RTYPE_CLIENT_SCENES_GAMEPADSETTINGSSCENE_HPP_
10
11 #include "Interfaces/IScene.hpp"
12 #include "RType/ECS/Registry.hpp"
13 #include "UI/UiFactory.hpp"
14 #include "Utils/GameState.hpp"
15 #include "Systems/NetworkSyncSystem.hpp"
17 #include "Core/Settings.hpp"
18 #include <SFML/Graphics.hpp>
19 #include <memory>
20 #include <functional>
21 #include <unordered_map>
22
23namespace rtp::client {
24 namespace scenes {
25
26 enum class GamepadAction {
27 Shoot,
28 Reload,
29 Pause
30 };
31
37 {
38 public:
40 Settings& settings,
41 TranslationManager& translationManager,
42 NetworkSyncSystem& network,
43 graphics::UiFactory& uiFactory,
44 std::function<void(GameState)> changeState);
45
46 using ChangeStateFn = std::function<void(GameState)>;
47
48 void onEnter() override;
49 void onExit() override;
50 void handleEvent(const sf::Event& event) override;
51 void update(float dt) override;
52
53 private:
55 std::string getButtonName(unsigned int button) const;
56
63
66 std::unordered_map<GamepadAction, ecs::Entity> _actionToButton;
67 };
68 } // namespace scenes
69} // namespace rtp::client
70
71#endif // RTYPE_CLIENT_SCENES_GAMEPADSETTINGSSCENE_HPP_
System to handle network-related operations on the client side.
Manages game settings and preferences.
Definition Settings.hpp:67
Manages game translations for all UI elements.
Factory class for creating UI components in the ECS registry.
Definition UiFactory.hpp:72
Interface for different scenes in the client application.
Definition IScene.hpp:23
Scene for configuring gamepad settings.
std::unordered_map< GamepadAction, ecs::Entity > _actionToButton
void handleEvent(const sf::Event &event) override
Handle an incoming event.
void onEnter() override
Called when the scene is entered.
std::function< void(GameState)> ChangeStateFn
void update(float dt) override
Update the scene state.
std::string getButtonName(unsigned int button) const
void onExit() override
Called when the scene is exited.
R-Type client namespace.