POC for entities.

This commit is contained in:
2025-02-01 21:03:22 -05:00
parent 4c43cce133
commit fc5e09fab0
16 changed files with 254 additions and 32 deletions

View 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