Skip to content

Commit

Permalink
Basic types to hold room info #11 #16
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaudic committed Jan 13, 2020
1 parent 2fe39f8 commit e257d1e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/common/commonroom.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* \file commonroom.hpp
* \brief Common definitions for a room in client and server side
* \author G. B.
* \version 0.1a
* \date 13/01/2020
*/
/* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This Source Code Form is “Incompatible With Secondary Licenses”,
* as defined by the Mozilla Public License, v. 2.0.
*/

#ifndef _H_COMMONROOM_
#define _H_COMMONROOM_

#include <string>
#include <SDL2/SDL.h>

/**
* Status of a room
*/
enum class RoomStatus {
WAITING, //! still accepting players
FULL, //! all seats full, entrance not permitted
PLAYING //! game being played
};

struct RoomBasicInfo {
Uint16 number;
std::string name;
bool hasPassword;
RoomStatus status;
std::string mapName;
};

#endif //! _H_COMMONROOM_
1 change: 1 addition & 0 deletions src/ui/roombutton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <string>
#include <guisan.hpp>
#include "../constants.hpp"
#include "../common/commonroom.hpp"

/**
* @brief An improved button to represent a room
Expand Down

0 comments on commit e257d1e

Please sign in to comment.