Question: In C++ For this assignment you will be creating the lobby for a game. In normal game lobbies players will connect to the lobby and
In C++
For this assignment you will be creating the lobby for a game. In normal game lobbies players will connect to the lobby and then signal for the game to start. Although this is normally done over network, we will be simulating this using only a local computer. To do this project you will need three things:
a Lobby class
a Player class
and a Player_state enum
The lobby class has two jobs: to hold all the players and to check if they are all ready to start the game. So, this is what you will need for the Lobby class.



To do this project vou will need three things: a Lobby class a Player class and a Player state enum The lobby class has two jobs: to hold all the players and to check if they are all ready to start the game. So, this is what you will need for the Lobby class Instance variables representing lobby_id * Note that this id MUST be unique to the lobby, so if we make a bunch of lobbies at the same tim e none of them should have the same id The list of players The maximum size of the lobby. The minimum number of players required to start the game. Constructor -initializes lobby id should initialize the min number of players and the max size of the lobby the list of players is initially empty e Instance functions - check_if_all_players ready () - checks if all the players are ready check_if_ready_to_start_game) checks if the number of players is within the specified range, and if all the plavers are readv start_game ) starts the game and you just need to print "Game Started" join_game (Player player id) - connects a player to the game and adds the player to the list of players leave_game (Player player_id) - disconnects a player from the game and removes the player from the list of players
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
