SHADE_Y3/SHADE_Engine/src/ECS_Base/SHECSMacros.h

25 lines
505 B
C
Raw Normal View History

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;
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