EntityWrapper to uniquely identify entities and make using them a little easier
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#ifndef EntityWrapper_h__
|
||||
#define EntityWrapper_h__
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include "ComponentWrapper.h"
|
||||
|
||||
class World;
|
||||
struct EntityWrapper
|
||||
{
|
||||
EntityWrapper(::World* world, EntityID id)
|
||||
: World(world)
|
||||
, ID(id)
|
||||
{ }
|
||||
|
||||
::World* World;
|
||||
EntityID ID;
|
||||
|
||||
bool HasComponent(const std::string& componentName);
|
||||
|
||||
ComponentWrapper operator[](const std::string& componentName);
|
||||
bool operator==(const EntityWrapper& e);
|
||||
explicit operator EntityID();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user