(NDK) First commit

-Still missing a build file
-This is an Entity Component System, without any component nor system,
so this is an Entity. Yay.


Former-commit-id: f04d2fdfe8819826f940469c2618140a26afa637
This commit is contained in:
Lynix
2015-02-06 13:56:27 +01:00
parent d6c08db282
commit 5067767074
5 changed files with 345 additions and 0 deletions

47
SDK/include/NDK/World.hpp Normal file
View File

@@ -0,0 +1,47 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Development Kit"
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#pragma once
#ifndef NDK_WORLD_HPP
#define NDK_WORLD_HPP
#include <Nazara/Core/NonCopyable.hpp>
#include <NDK/Prerequesites.hpp>
#include <NDK/Entity.hpp>
#include <vector>
namespace Ndk
{
class NDK_API World : NzNonCopyable
{
public:
using EntityList = std::vector<Entity>;
World();
~World();
Entity CreateEntity();
EntityList CreateEntities(unsigned int count);
void KillEntity(Entity& entity);
void KillEntities(EntityList& list);
Entity GetEntity(Entity::Id id);
bool IsEntityValid(const Entity& entity) const;
bool IsEntityIdValid(Entity::Id id) const;
void Update();
private:
std::vector<nzUInt32> m_entitiesCounter;
std::vector<Entity::Id> m_freeIdList;
EntityList m_aliveEntities;
EntityList m_killedEntities;
nzUInt32 m_nextIndex;
};
}
#endif // NDK_WORLD_HPP