45 ServerScene(
eng::id assignedId,
const std::shared_ptr<eng::IRenderer> &renderer,
const std::string &host,
46 const std::string &port,
const std::string &playerName);
98 std::function<void(
const std::string &playerName,
const std::string &serverIP,
99 const std::string &serverPort)>
112 const std::vector<std::string>
m_serverOptions = {
"Player Name",
"Server IP",
"Server Port",
"Connect",
122 void connectServer(
const std::string &playerName,
const std::string &serverIP,
123 const std::string &serverPort)
const;
Abstract class for scene.
Scene for configuring and establishing server connection.
void event(const eng::Event &event) override
Handle input events.
ecs::Entity m_serverPortValueEntity
Text entity displaying server port.
bool m_playMusic
Music playback state flag.
std::function< void()> onBackToMenu
Callback triggered when player returns to main menu.
~ServerScene() override=default
Destructor.
std::string m_port
Server port input field.
float m_animationTime
Animation timer for visual effects.
void updateValueDisplay()
Update the visual display of input values.
std::function< void(const std::string &playerName, const std::string &serverIP, const std::string &serverPort)> onConnect
Callback triggered when player attempts to connect.
void connectServer(const std::string &playerName, const std::string &serverIP, const std::string &serverPort) const
Initiate server connection with provided settings.
ServerScene & operator=(ServerScene &&other)=delete
Deleted move assignment operator (non-movable)
std::string m_host
Server host/IP input field.
ecs::Entity m_playerNameValueEntity
Text entity displaying player name.
ServerScene & operator=(const ServerScene &other)=delete
Deleted copy assignment operator (non-copyable)
const std::vector< std::string > m_serverOptions
ecs::Entity m_serverIPValueEntity
Text entity displaying server IP.
ServerScene(eng::id assignedId, const std::shared_ptr< eng::IRenderer > &renderer, const std::string &host, const std::string &port, const std::string &playerName)
Constructor.
std::string & getCurrentEditField()
Get reference to the currently selected input field.
bool & playMusic()
Get music playback state.
size_t m_selectedIndex
Currently selected menu option index.
std::string m_playerName
Player name input field.
ServerScene(const ServerScene &other)=delete
Deleted copy constructor (non-copyable)
ServerScene(ServerScene &&other)=delete
Deleted move constructor (non-movable)
void update(float dt, const eng::WindowSize &size) override
Update the scene (called each frame)
This file contains the IScene class.