2022-07-18 22:42:58 +00:00
|
|
|
#ifndef _TGAMETYPES_HPP
|
|
|
|
#define _TGAMETYPES_HPP
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-08-09 23:03:51 +00:00
|
|
|
struct TAreaId;
|
|
|
|
struct TEditorId;
|
|
|
|
struct TUniqueId;
|
2022-07-18 22:42:58 +00:00
|
|
|
|
|
|
|
extern TAreaId kInvalidAreaId;
|
|
|
|
extern TEditorId kInvalidEditorId;
|
|
|
|
extern TUniqueId kInvalidUniqueId;
|
|
|
|
|
2022-08-09 23:03:51 +00:00
|
|
|
struct TAreaId {
|
|
|
|
s32 value;
|
|
|
|
|
|
|
|
TAreaId() : value(-1) {}
|
|
|
|
TAreaId(s32 value) : value(value) {}
|
|
|
|
s32 Value() const { return value; }
|
|
|
|
|
|
|
|
bool operator==(const TAreaId& other) const { return value == other.value; }
|
|
|
|
bool operator!=(const TAreaId& other) const { return value != other.value; }
|
|
|
|
};
|
2022-08-11 02:33:46 +00:00
|
|
|
|
2022-08-09 23:03:51 +00:00
|
|
|
struct TEditorId {
|
|
|
|
u32 value;
|
|
|
|
|
|
|
|
TEditorId() : value(-1) {}
|
|
|
|
TEditorId(u32 value) : value(value) {}
|
2022-08-11 02:33:46 +00:00
|
|
|
u32 Value() const { return value; }
|
|
|
|
|
|
|
|
bool operator==(const TEditorId& other) const { return value == other.value; }
|
|
|
|
bool operator!=(const TEditorId& other) const { return value != other.value; }
|
2022-08-09 23:03:51 +00:00
|
|
|
};
|
2022-08-11 02:33:46 +00:00
|
|
|
|
2022-08-09 23:03:51 +00:00
|
|
|
struct TUniqueId {
|
2022-08-11 02:33:46 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
u16 version : 6;
|
|
|
|
u16 id : 10;
|
|
|
|
};
|
|
|
|
u16 value;
|
|
|
|
};
|
2022-08-09 23:03:51 +00:00
|
|
|
|
|
|
|
TUniqueId() : value(-1) {}
|
|
|
|
TUniqueId(u16 value) : value(value) {}
|
2022-08-11 02:33:46 +00:00
|
|
|
u16 Value() const { return value; }
|
|
|
|
|
|
|
|
bool operator==(const TUniqueId& other) const { return value == other.value; }
|
|
|
|
bool operator!=(const TUniqueId& other) const { return value != other.value; }
|
2022-08-09 23:03:51 +00:00
|
|
|
};
|
|
|
|
|
2022-07-18 22:42:58 +00:00
|
|
|
#endif
|