1 #include "DS_Table.h"
2 
3 #ifndef __ROOM_TYPES_H
4 #define __ROOM_TYPES_H
5 
6 enum RoomMemberMode
7 {
8 	/// The owner of the room, who is also a player in the room. The owner cannot be a spectator
9 	RMM_MODERATOR,
10 
11 	/// The room member is a player in a public slot
12 	RMM_PUBLIC,
13 
14 	/// The room member is a player in a reserved slot
15 	RMM_RESERVED,
16 
17 	/// The room member is a spectator in a public slot.
18 	RMM_SPECTATOR_PUBLIC,
19 
20 	/// The room member is a spectator in a reserved slot.
21 	RMM_SPECTATOR_RESERVED,
22 
23 	/// Used as a query flag - join any slot that is playable (reserved or public)
24 	RMM_ANY_PLAYABLE,
25 
26 	/// Used as a query flag - join any slot that is for a spectator (reserved or public)
27 	RMM_ANY_SPECTATOR,
28 };
29 
30 const char *RoomMemberModeToEnum(RoomMemberMode e);
31 
32 struct DefaultRoomColumns
33 {
34 	enum
35 	{
36 		TC_TITLE_NAME,
37 		TC_TITLE_ID,
38 		TC_ROOM_NAME,
39 		TC_ROOM_ID,
40 		TC_TOTAL_SLOTS,
41 		TC_TOTAL_PUBLIC_PLUS_RESERVED_SLOTS,
42 		TC_USED_SLOTS,
43 		TC_USED_PUBLIC_PLUS_RESERVED_SLOTS,
44 		TC_REMAINING_SLOTS,
45 		TC_REMAINING_PUBLIC_PLUS_RESERVED_SLOTS,
46 		TC_TOTAL_PUBLIC_SLOTS,
47 		TC_TOTAL_RESERVED_SLOTS,
48 		TC_TOTAL_SPECTATOR_SLOTS,
49 		TC_USED_PUBLIC_SLOTS,
50 		TC_USED_RESERVED_SLOTS,
51 		TC_USED_SPECTATOR_SLOTS,
52 		TC_REMAINING_PUBLIC_SLOTS,
53 		TC_REMAINING_RESERVED_SLOTS,
54 		TC_REMAINING_SPECTATOR_SLOTS,
55 		TC_CREATION_TIME,
56 		TC_DESTROY_ON_MODERATOR_LEAVE,
57 		TC_LOBBY_ROOM_PTR,
58 		TC_TABLE_COLUMNS_COUNT
59 	} columnId;
60 
61 	const char *columnName;
62 	DataStructures::Table::ColumnType columnType;
63 
64 	static const char *GetColumnName(int columnId);
65 	static int GetColumnIndex(const char *columnName);
66 	static DataStructures::Table::ColumnType GetColumnType(int columnId);
67 	static bool HasColumnName(const char *columnName);
68 	static void AddDefaultColumnsToTable(DataStructures::Table *table);
69 	static bool HasDefaultColumns(DataStructures::Table *table);
70 };
71 
72 #endif
73