POC for entities.
This commit is contained in:
33
Juliet/include/Engine/Class.h
Normal file
33
Juliet/include/Engine/Class.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <Core/Common/CRC32.h>
|
||||
#include <Juliet.h>
|
||||
|
||||
namespace Juliet
|
||||
{
|
||||
struct Class
|
||||
{
|
||||
uint32 CRC;
|
||||
#if JULIET_DEBUG
|
||||
// TODO: string struct may be
|
||||
const char* Name;
|
||||
size_t Name_Length;
|
||||
#endif
|
||||
|
||||
consteval Class(const char* className, size_t name_length)
|
||||
{
|
||||
CRC = crc32(className, name_length);
|
||||
#if JULIET_DEBUG
|
||||
// TODO: string struct may be
|
||||
Name = className;
|
||||
Name_Length = name_length;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
template <typename type>
|
||||
bool IsA(Class& cls)
|
||||
{
|
||||
return cls.CRC == type::StaticClass->CRC;
|
||||
}
|
||||
} // namespace Juliet
|
||||
Reference in New Issue
Block a user