31 type_id_(static_cast<uint32_t>(type_id)) {
37 bool operator ==(T type_id)
const {
return type_id_ ==
static_cast<uint32_t
>(type_id); }
38 bool operator ==(uint32_t type_id)
const {
return type_id_ == type_id; }
39 bool operator ==(
int type_id)
const {
return static_cast<uint32_t
>(type_id_) == type_id; }
44 bool operator !=(T type_id)
const {
return type_id_ !=
static_cast<uint32_t
>(type_id); }
45 bool operator !=(uint32_t type_id)
const {
return type_id_ != type_id; }
46 bool operator !=(
int type_id)
const {
return static_cast<uint32_t
>(type_id_) != type_id; }
49 bool operator<(const SC2Type<T>& other)
const {
return type_id_ < other.type_id_; }
52 operator uint32_t()
const {
return type_id_; }
54 operator T()
const {
return static_cast<T
>(type_id_); }
58 bool IsValid()
const {
return type_id_ != 0; }
62 std::string
to_string()
const {
return std::to_string(type_id_); }
66 T
ToType()
const {
return static_cast<T
>(type_id_); }
bool operator!=(SC2Type< T > type_id) const
Definition: sc2_types.h:43
std::string to_string() const
Definition: sc2_types.h:62
SC2Type(uint32_t type_id)
Construct from an integer, corresponds to the enum value.
Definition: sc2_types.h:26
bool operator==(SC2Type< T > type_id) const
Definition: sc2_types.h:36
Definition: sc2_action.h:9
SC2Type(T type_id)
Construct from the enum.
Definition: sc2_types.h:30
SC2Type()
Default constructor.
Definition: sc2_types.h:22
Definition: sc2_types.h:19
bool IsValid() const
Definition: sc2_types.h:58
T ToType() const
Definition: sc2_types.h:66