Editor entity create and delete.

This commit is contained in:
2016-01-18 19:26:00 +01:00
parent 631dd57eeb
commit d4242bbead
5 changed files with 49 additions and 14 deletions
+3 -1
View File
@@ -45,7 +45,7 @@ public:
void SetEntityCreateCallback(OnEntityCreate_t f) { m_OnEntityCreate = f; }
// Called when the user means to delete an entity.
typedef std::function<void(EntityWrapper)> OnEntityDelete_t;
void SetEntityCreateCallback(OnEntityDelete_t f) { m_OnEntityDelete = f; }
void SetEntityDeleteCallback(OnEntityDelete_t f) { m_OnEntityDelete = f; }
// Called when the user means to attach a new component to an entity.
typedef std::function<void(EntityWrapper, const std::string&)> OnComponentAttach_t;
void SetComponentAttachCallback(OnComponentAttach_t f) { m_OnComponentAttach = f; }
@@ -80,6 +80,8 @@ private:
// Entity file handling methods
void entityImport(World* world);
void entitySave(EntityWrapper entity);
void entityCreate(World* world, EntityWrapper parent);
void entityDelete(EntityWrapper entity);
// UI drawing methods
void drawMenu();
+2
View File
@@ -38,6 +38,8 @@ private:
// GUI callbacks
void OnEntitySelected(EntityWrapper entity);
void OnEntitySave(EntityWrapper entity, boost::filesystem::path filePath);
EntityWrapper OnEntityCreate(EntityWrapper parent);
void OnEntityDelete(EntityWrapper entity);
void OnComponentAttach(EntityWrapper entity, const std::string& componentType);
void OnComponentDelete(EntityWrapper entity, const std::string& componentType);
};