1#include "CurtainViewComponent.h"
3#include "CurtainViewSystem.h"
6#include "EntityDefinition.h"
7#include "EntityStore.h"
8#include "ResourceManifest.h"
9#include "ExtensionRegistry.h"
10#include "Resources/ResourceStore.h"
12namespace Cogs::Core::CurtainView
21 CurtainViewComponent::registerType();
26 const std::string resourceArchive =
"Cogs.Core.Extensions.CurtainView.zip";
29 bool resourceArchiveAdded =
false;
30 auto manifest = getResourceManifest(context);
31 for (
auto& item : manifest) {
32 if (item.find(resourceArchive) != std::string::npos) {
34 resourceArchiveAdded =
true;
38 if (!resourceArchiveAdded) {
42 context->
resourceStore->addSearchPath(
"../Extensions/CurtainView/Data/");
49 definition.
name =
"CurtainView";
50 definition.
components = std::vector<std::string>{
"TransformComponent",
"SceneComponent",
"CurtainViewComponent",
"MeshComponent",
"MeshRenderComponent" };
56 } curtainViewExtensionInstance;
A Context instance contains all the services, systems and runtime components needed to use Cogs.
class EntityStore * store
Entity store.
std::unique_ptr< class ResourceStore > resourceStore
ResourceStore service instance.
void addEntityDefinition(const EntityDefinition &definition)
Add the given entity definition to the store.
static void add(Extension *extension, StringView version)
Adds the given extension to the registry, ensuring the initialization methods are called at appropria...
const char * getExtensionKey() const override
Get the extensions unique key, used to check for extension presence and retrieve extension specific d...
bool initialize(Context *context) override
Initialize extension for the given context.
bool initializeStatic() override
Initialize extension statically.
Defines how to construct entities of a certain type by a list of components to instantiate and defaul...
std::vector< std::string > components
Names of the component types to instantiate when creating an entity from this definition.
Defines an extension to Cogs.Core and provides methods to override in order to initialize extension c...
@ PreDynamicComponents
Run before the dynamic components.