conversion to c by gemini 4 argon
This commit is contained in:
1 parent
b70e2d21d2
commit
f9356f9ba7
369 files changed
+18074
-107634
No files matched your search
+20
-16
@@ -3,11 +3,13 @@
|
||||
#include <Core/Container/Vector.h>
|
||||
#include <Entity/entity_common.h>
|
||||
|
||||
struct World;
|
||||
struct EntityTemplate;
|
||||
struct Entity;
|
||||
struct Class;
|
||||
typedef struct World World;
|
||||
typedef struct EntityTemplate EntityTemplate;
|
||||
typedef struct Entity Entity;
|
||||
typedef struct Class Class;
|
||||
typedef struct Archive Archive;
|
||||
|
||||
typedef struct typed_entity_array typed_entity_array;
|
||||
struct typed_entity_array
|
||||
{
|
||||
Arena* arena;
|
||||
@@ -15,22 +17,24 @@ struct typed_entity_array
|
||||
size_t count;
|
||||
};
|
||||
|
||||
typedef struct EntityManager EntityManager;
|
||||
struct EntityManager
|
||||
{
|
||||
static EntityID ID;
|
||||
uint64 next_local_counter = 1ULL;
|
||||
uint64 next_local_counter;
|
||||
|
||||
// TODO: Should be a pool
|
||||
VectorArena<Entity, 100'000> Entities;
|
||||
VectorArena Entities;
|
||||
|
||||
typed_entity_array by_type[ENTITY(Count)];
|
||||
typed_entity_array by_type[Entity_Type_Count];
|
||||
};
|
||||
|
||||
void InitEntityManager(NonNullPtr<World> world);
|
||||
void ShutdownEntityManager();
|
||||
EntityManager& GetEntityManager();
|
||||
EntityTemplate* RegisterEntity(EntityManager& manager, Entity* base, DerivedType entity);
|
||||
[[nodiscard]] Entity* allocate_entity(EntityManager& manager, NonNullPtr<const Class> derived_type_class);
|
||||
void UpdateEntityManager(EntityManager& manager);
|
||||
[[nodiscard]] Entity* deserialize_entity(Archive& archive, EntityManager& manager);
|
||||
void update_local_counter(EntityManager& manager, EntityID entity_id);
|
||||
extern EntityID g_entity_manager_id;
|
||||
|
||||
void InitEntityManager(World* world);
|
||||
void ShutdownEntityManager(void);
|
||||
EntityManager* GetEntityManager(void);
|
||||
EntityTemplate* RegisterEntity(EntityManager* manager, Entity* base, DerivedType entity);
|
||||
Entity* allocate_entity(EntityManager* manager, const Class* derived_type_class);
|
||||
void UpdateEntityManager(EntityManager* manager);
|
||||
Entity* deserialize_entity(Archive* archive, EntityManager* manager);
|
||||
void update_local_counter(EntityManager* manager, EntityID entity_id);
|
||||
Reference in new issue
Block a user