2022-09-08 11:08:23 +08:00
|
|
|
#ifndef SH_MACROS_H
|
|
|
|
#define SH_MACROS_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <type_traits>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef uint32_t EntityID;
|
|
|
|
typedef uint16_t EntityIndex;
|
|
|
|
typedef uint32_t ComponentTypeID;
|
|
|
|
|
|
|
|
|
2022-09-13 14:07:40 +08:00
|
|
|
|
|
|
|
|
2022-09-08 11:08:23 +08:00
|
|
|
const EntityIndex MAX_EID = 51000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ENABLE_IF_DERIVED(__RETURN__, __BASE__, __DERIVED__)\
|
|
|
|
std::enable_if_t<std::is_base_of_v<__BASE__,__DERIVED__>,__RETURN__>
|
|
|
|
|
|
|
|
|
|
|
|
#define ENABLE_IF_UINT(_TYPE, _RETURN)\
|
|
|
|
typename std::enable_if<(std::is_integral<_TYPE>::value && !std::is_signed<_TYPE>::value),_RETURN>::type
|
|
|
|
|
|
|
|
#endif
|