R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
IRoomManager.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Created by hugo on 06/12/2025
4** File description:
5** IRoomManager.hpp
6*/
7
8#pragma once
9
10#include <memory>
11#include <string>
12#include <vector>
13#include "server/Rooms/Room.hpp"
14
15namespace server {
16
22 public:
23 virtual ~IRoomManager() = default;
24
34 virtual std::shared_ptr<Room> createRoom(const std::string &id, const std::string &name = "",
35 size_t maxPlayers = 4, bool isPrivate = false,
36 float gameSpeedMultiplier = 1.0f) = 0;
37
43 virtual std::shared_ptr<Room> getRoom(const std::string &id) = 0;
44
50 virtual bool removeRoom(const std::string &id) = 0;
51
56 virtual std::vector<std::shared_ptr<Room>> getAllRooms() = 0;
57
62 virtual std::vector<std::shared_ptr<Room>> getPublicRooms() = 0;
63
68 virtual size_t getRoomCount() const = 0;
69
75 virtual bool update(float deltaTime) = 0;
76 };
77
78} // namespace server
Interface for managing game rooms.
virtual std::vector< std::shared_ptr< Room > > getPublicRooms()=0
Get all public rooms (not private)
virtual std::vector< std::shared_ptr< Room > > getAllRooms()=0
Get all active rooms.
virtual std::shared_ptr< Room > createRoom(const std::string &id, const std::string &name="", size_t maxPlayers=4, bool isPrivate=false, float gameSpeedMultiplier=1.0f)=0
Create a new room.
virtual size_t getRoomCount() const =0
Get number of active rooms.
virtual bool update(float deltaTime)=0
Update all rooms (called by server loop)
virtual ~IRoomManager()=default
virtual bool removeRoom(const std::string &id)=0
Remove a room by ID.
virtual std::shared_ptr< Room > getRoom(const std::string &id)=0
Retrieve a room by ID.