-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathDamageType.h
More file actions
79 lines (74 loc) · 2.51 KB
/
Copy pathDamageType.h
File metadata and controls
79 lines (74 loc) · 2.51 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
#pragma once
#include <BWAPI/Type.h>
namespace BWAPI
{
/// <summary>Namespace containing damage types.</summary>
///
/// @see DamageType
///
/// [View on Liquipedia](http://wiki.teamliquid.net/starcraft/Damage_Type)<br>
/// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)<br>
/// [View on Starcraft Wikia](http://starcraft.wikia.com/wiki/Damage_types)<br>
namespace DamageTypes
{
/// <summary>Enumeration of damage types.</summary>
/// @see DamageType
namespace Enum
{
/// <summary>Enumeration of damage types.</summary>
/// @see DamageType
enum Enum
{
Independent,
Explosive,
Concussive,
Normal,
Ignore_Armor,
None,
Unknown,
MAX
};
}
}
/// <summary>Damage types are used in Broodwar to determine the amount of damage that will be
/// done to a unit.</summary> This corresponds with UnitSizeType to determine the damage done to
/// a unit.
///
/// @see WeaponType, DamageTypes, UnitSizeType
///
/// [View on Liquipedia](http://wiki.teamliquid.net/starcraft/Damage_Type)<br>
/// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)<br>
/// [View on Starcraft Wikia](http://starcraft.wikia.com/wiki/Damage_types)<br>
///
/// @ingroup TypeClasses
class DamageType : public Type<DamageType, DamageTypes::Enum::Unknown>
{
public:
/// @copydoc Type::Type(int)
constexpr explicit DamageType(int id = DamageTypes::Enum::None) : Type(id) {}
};
/// @ingroup Types
namespace DamageTypes
{
/// <summary>Retrieves the set of all the DamageTypes.</summary>
///
/// @returns Set of DamageTypes.
const DamageType::set& allDamageTypes();
constexpr DamageType Independent{Enum::Independent};
constexpr DamageType Explosive{Enum::Explosive};
constexpr DamageType Concussive{Enum::Concussive};
constexpr DamageType Normal{Enum::Normal};
constexpr DamageType Ignore_Armor{Enum::Ignore_Armor};
constexpr DamageType None{Enum::None};
constexpr DamageType Unknown{Enum::Unknown};
}
static_assert(sizeof(DamageType) == sizeof(int), "Expected type to resolve to primitive size.");
} // namespace BWAPI
namespace std {
template<>
struct hash<BWAPI::DamageType> {
auto operator()(BWAPI::DamageType id) const {
return BWAPI::DamageType::Hash{}(id);
}
};
} // namespace std