40 lines
916 B
C
40 lines
916 B
C
#pragma once
|
|
|
|
#include <Core/Common/String.h>
|
|
#include <Core/Container/Vector.h>
|
|
#include <Core/Memory/MemoryArena.h>
|
|
#include <Entity/Entity.h>
|
|
|
|
typedef struct Archive Archive;
|
|
typedef struct EntityManager EntityManager;
|
|
|
|
#pragma pack(push, 1)
|
|
typedef struct WorldFileHeader WorldFileHeader;
|
|
struct WorldFileHeader
|
|
{
|
|
uint32 Magic; // 0x444C574A ('JWLD' in little-endian)
|
|
};
|
|
#pragma pack(pop)
|
|
|
|
#define kWorldMagic ((uint32)0x444C574A) // 'JWLD'
|
|
#define kWorldVersion ((uint32)1)
|
|
|
|
typedef struct World World;
|
|
struct World
|
|
{
|
|
Arena* WorldArena;
|
|
EntityManager* EntityManager;
|
|
};
|
|
|
|
void InitWorld(World* world, Arena* arena);
|
|
void ShutdownWorld(World* world);
|
|
|
|
void AddToWorld(World* world, Entity* entity);
|
|
void RemoveWorldEntity(World* world, size_t index);
|
|
|
|
void SerializeWorld(Archive* data, World* world, String filename);
|
|
|
|
#if JULIET_EDITOR
|
|
void RenderWorldEditorUI(World* world);
|
|
#endif
|