forked from Dzejrou/tdt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDestructorHelper.hpp
40 lines (36 loc) · 1.21 KB
/
DestructorHelper.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <cstdlib>
#include <string>
#include "lppscript/LppScript.hpp"
#include "Components.hpp"
class EntitySystem;
/**
* Namespace containing auxiliary functions that help with the management of
* the destructor component.
*/
namespace DestructorHelper
{
/**
* Brief: Sets the name of the table that contains the "dtor" function
* which get's called when a given entity is destroyed.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
* Param: The new blueprint table's name.
*/
void set_blueprint(EntitySystem&, std::size_t, const std::string&);
/**
* Brief: Returns the name of the table that contains the "dtor" function
* which get's called when a given entity is destroyed.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
*/
const std::string& get_blueprint(EntitySystem&, std::size_t);
/**
* Brief: Destroys a given entity and if possible calls it's destructor.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
* Param: If true, the destructor won't be called.
* Param: ID of the killer (if any).
*/
void destroy(EntitySystem&, std::size_t, bool = false, std::size_t = Component::NO_ENTITY);
}