-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathGameType.h
More file actions
89 lines (83 loc) · 2.62 KB
/
Copy pathGameType.h
File metadata and controls
89 lines (83 loc) · 2.62 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#pragma once
#include <BWAPI/Type.h>
namespace BWAPI
{
/// <summary>Namespace containing game types.</summary>
/// @see GameType
namespace GameTypes
{
/// <summary>Enumeration of game types.</summary>
/// @see GameType
namespace Enum
{
/// <summary>Enumeration of game types.</summary>
/// @see GameType
enum Enum
{
None = 0,
Custom, // Warcraft III
Melee,
Free_For_All,
One_on_One,
Capture_The_Flag,
Greed,
Slaughter,
Sudden_Death,
Ladder,
Use_Map_Settings,
Team_Melee,
Team_Free_For_All,
Team_Capture_The_Flag,
Unknown_0x0E,
Top_vs_Bottom,
Iron_Man_Ladder, // Warcraft II
Pro_Gamer_League = 32, // Not valid
Unknown,
MAX
};
}
}
/// <summary>A class that represents game types in Broodwar.</summary> A game type is selected
/// when creating a game.
///
/// @see GameTypes
/// @ingroup TypeClasses
class GameType : public Type<GameType, GameTypes::Enum::Unknown>
{
public:
/// @copydoc Type::Type(int)
constexpr explicit GameType(int id = GameTypes::Enum::None) : Type(id) {}
};
/// @ingroup Types
namespace GameTypes
{
/// <summary>Retrieves the set of all the valid GameTypes.</summary>
///
/// @returns Set of available GameTypes.
const GameType::set& allGameTypes();
constexpr GameType Melee{Enum::Melee};
constexpr GameType Free_For_All{Enum::Free_For_All};
constexpr GameType One_on_One{Enum::One_on_One};
constexpr GameType Capture_The_Flag{Enum::Capture_The_Flag};
constexpr GameType Greed{Enum::Greed};
constexpr GameType Slaughter{Enum::Slaughter};
constexpr GameType Sudden_Death{Enum::Sudden_Death};
constexpr GameType Ladder{Enum::Ladder};
constexpr GameType Use_Map_Settings{Enum::Use_Map_Settings};
constexpr GameType Team_Melee{Enum::Team_Melee};
constexpr GameType Team_Free_For_All{Enum::Team_Free_For_All};
constexpr GameType Team_Capture_The_Flag{Enum::Team_Capture_The_Flag};
constexpr GameType Top_vs_Bottom{Enum::Top_vs_Bottom};
constexpr GameType None{Enum::None};
constexpr GameType Unknown{Enum::Unknown};
}
static_assert(sizeof(GameType) == sizeof(int), "Expected type to resolve to primitive size.");
} // namespace BWAPI
namespace std {
template<>
struct hash<BWAPI::GameType> {
auto operator()(BWAPI::GameType id) const {
return BWAPI::GameType::Hash{}(id);
}
};
} // namespace std