-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathUnitSizeType.h
More file actions
73 lines (67 loc) · 2.15 KB
/
Copy pathUnitSizeType.h
File metadata and controls
73 lines (67 loc) · 2.15 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
#pragma once
#include <BWAPI/Type.h>
namespace BWAPI
{
/// <summary>Namespace containing unit size types.</summary>
///
/// @see UnitSizeType
///
/// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)<br>
namespace UnitSizeTypes
{
/// <summary>Enumeration of unit size types.</summary>
/// @see UnitSizeType
namespace Enum
{
/// <summary>Enumeration of unit size types.</summary>
/// @see UnitSizeType
enum Enum
{
Independent = 0,
Small,
Medium,
Large,
None,
Unknown,
MAX
};
}
}
/// <summary>Size types are used by unit types in Broodwar to determine how much damage will be
/// applied.</summary> This corresponds with DamageType for several different damage reduction
/// applications.
///
/// @see DamageType, UnitType, UnitSizeTypes
///
/// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)<br>
/// @ingroup TypeClasses
class UnitSizeType : public Type<UnitSizeType, UnitSizeTypes::Enum::Unknown>
{
public:
/// @copydoc Type::Type(int)
constexpr explicit UnitSizeType(int id = UnitSizeTypes::Enum::None) : Type(id) {}
};
/// @ingroup Types
namespace UnitSizeTypes
{
/// <summary>Retrieves the set of all valid UnitSizeTypes.</summary>
///
/// @returns Set of all UnitSizeTypes.
const UnitSizeType::set& allUnitSizeTypes();
constexpr UnitSizeType Independent{Enum::Independent};
constexpr UnitSizeType Small{Enum::Small};
constexpr UnitSizeType Medium{Enum::Medium};
constexpr UnitSizeType Large{Enum::Large};
constexpr UnitSizeType None{Enum::None};
constexpr UnitSizeType Unknown{Enum::Unknown};
}
static_assert(sizeof(UnitSizeType) == sizeof(int), "Expected type to resolve to primitive size.");
} // namespace BWAPI
namespace std {
template<>
struct hash<BWAPI::UnitSizeType> {
auto operator()(BWAPI::UnitSizeType id) const {
return BWAPI::UnitSizeType::Hash{}(id);
}
};
} // namespace std