INNER CODE UNIT · C++

DemoComponent

JuDelCo/Entitas-Cpp · main.cpp:13

class DemoComponent : public IComponent {
	public:
		void Reset(const std::string& name1, const std::string& name2) {
			std::cout << "Created new entity: " << name1 << "," << name2 << std::endl;
		}
};

class DemoSystem : public IInitializeSystem, public IExecuteSystem, public ISetPoolSystem {
	public:
		void SetPool(Pool* pool) {
			mPool = pool;
		}
		void Initialize() {
			mPool->CreateEntity()->Add<DemoComponent>("foo", "bar");
			std::cout << "DemoSystem initialized" << std::endl;
		}
		void Execute() {
			mPool->CreateEntity()->Add<DemoComponent>("foo", "bar");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…