-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathGameLobby.h
More file actions
39 lines (31 loc) · 1.11 KB
/
GameLobby.h
File metadata and controls
39 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
//
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "GlobalGameSettings.h"
#include <vector>
struct JoinPlayerInfo;
/// Model of the game lobby (preparation when starting a map)
/// Not to be confused with the lobby (List of online games)
class GameLobby
{
public:
GameLobby(bool isSavegame, bool isHost, unsigned numPlayers);
~GameLobby();
JoinPlayerInfo& getPlayer(unsigned playerId);
const JoinPlayerInfo& getPlayer(unsigned playerId) const;
const std::vector<JoinPlayerInfo>& getPlayers() const { return players_; }
unsigned getNumPlayers() const;
void setNumPlayers(unsigned num);
GlobalGameSettings& getSettings() { return ggs_; }
const GlobalGameSettings& getSettings() const { return ggs_; }
bool isSavegame() const { return isSavegame_; }
bool isHost() const { return isHost_; }
private:
/// Is this a savegame or a loaded game?
bool isSavegame_;
/// Is this for the host/game creator
bool isHost_;
std::vector<JoinPlayerInfo> players_;
GlobalGameSettings ggs_;
};