This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Tortuga/server/server_application.hpp
T
2013-08-25 13:59:13 +10:00

38 lines
622 B
C++

#ifndef SERVERAPPLICATION_HPP_
#define SERVERAPPLICATION_HPP_
#include "base_room.hpp"
#include "SDL/SDL_thread.h"
#include <list>
#include <map>
#include <string>
struct RoomHandle {
SDL_Thread* thread = nullptr;
BaseRoom* room = nullptr;
};
class ServerApplication {
public:
ServerApplication();
~ServerApplication();
void Init();
void Loop();
void Quit();
bool SetRunning(bool b) { return running = b; }
bool GetRunning() const { return running; }
private:
void OpenRoom(std::map<std::string, std::string>);
void CloseRoom(RoomHandle);
std::list<RoomHandle> rooms;
bool running = true;
};
#endif