2022-07-25 17:18:30 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2022-07-06 02:20:39 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include "network/room.h"
|
|
|
|
#include "network/room_member.h"
|
|
|
|
|
|
|
|
namespace Network {
|
|
|
|
|
2022-07-22 16:31:13 +02:00
|
|
|
class RoomNetwork {
|
|
|
|
public:
|
|
|
|
RoomNetwork();
|
2022-07-06 02:20:39 +02:00
|
|
|
|
2022-07-22 16:31:13 +02:00
|
|
|
/// Initializes and registers the network device, the room, and the room member.
|
|
|
|
bool Init();
|
2022-07-06 02:20:39 +02:00
|
|
|
|
2022-07-22 16:31:13 +02:00
|
|
|
/// Returns a pointer to the room handle
|
|
|
|
std::weak_ptr<Room> GetRoom();
|
2022-07-06 02:20:39 +02:00
|
|
|
|
2022-07-22 16:31:13 +02:00
|
|
|
/// Returns a pointer to the room member handle
|
|
|
|
std::weak_ptr<RoomMember> GetRoomMember();
|
|
|
|
|
|
|
|
/// Unregisters the network device, the room, and the room member and shut them down.
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
private:
|
2022-07-25 17:08:20 +02:00
|
|
|
std::shared_ptr<RoomMember> m_room_member; ///< RoomMember (Client) for network games
|
|
|
|
std::shared_ptr<Room> m_room; ///< Room (Server) for network games
|
2022-07-22 16:31:13 +02:00
|
|
|
};
|
2022-07-06 02:20:39 +02:00
|
|
|
|
|
|
|
} // namespace Network
|