Cogs.Core
EntityWriter.h
1#pragma once
2
3#include "Resources/Resources.h"
4#include "AssetWriteFlags.h"
5
6#include "Foundation/ComponentModel/Entity.h"
7
8#ifdef _WIN32
9 #pragma warning(push)
10 #pragma warning(disable:4996)
11 #include "rapidjson/document.h"
12 #pragma warning(pop)
13#else
14 #include "rapidjson/document.h"
15#endif
16
17#include <string>
18#include <unordered_set>
19
20namespace Cogs::Core
21{
22 class Context;
23
25 {
26 std::unordered_set<ResourceHandleBase> assets;
27 std::unordered_set<ResourceHandleBase> meshes;
28 std::unordered_set<ResourceHandleBase> textures;
29 std::unordered_set<ResourceHandleBase> models;
30 std::unordered_set<ResourceHandleBase> materialInstances;
31 };
32
34 void COGSCORE_DLL_API writeEntity(Context * context, ComponentModel::Entity * entity, rapidjson::Value & object, rapidjson::Document & d, SerializationContext * sc = nullptr, const AssetWriteFlags flags = AssetWriteFlags::None);
35
37 rapidjson::Document COGSCORE_DLL_API writeEntity(Context * context, ComponentModel::Entity * entity, const AssetWriteFlags flags = AssetWriteFlags::None);
38}
Container for components, providing composition of dynamic entities.
Definition: Entity.h:18
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
AssetWriteFlags
Flags that control serialization of assets.
void COGSCORE_DLL_API writeEntity(Context *context, ComponentModel::Entity *entity, rapidjson::Value &object, rapidjson::Document &d, SerializationContext *sc=nullptr, const AssetWriteFlags flags=AssetWriteFlags::None)
Serialize entity adding entity to the given parent 'object'.