summary refs log tree commit diff stats
path: root/src/component.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-07 14:13:32 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-07 14:13:32 -0500
commit97d7fb425da906947cc45e11fadb35f708da50d6 (patch)
treeae1a4a5bbbce97e5dcf50e7390f005fe9be61356 /src/component.h
parentda3df061699203eccc9a0c98becaee3ce8050a4f (diff)
downloadtherapy-97d7fb425da906947cc45e11fadb35f708da50d6.tar.gz
therapy-97d7fb425da906947cc45e11fadb35f708da50d6.tar.bz2
therapy-97d7fb425da906947cc45e11fadb35f708da50d6.zip
Changed EntityManager to dense vector
This should improve speed, because entity lookup will be O(1) instead of O(log n). Deletion is also O(1). Insert stays at potentially O(n), but still should be overall faster than the previous method.

Also replaced some asserts with exceptions.

Also made Component polymorphic so that deletion actually works properly.
Diffstat (limited to 'src/component.h')
-rw-r--r--src/component.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/component.h b/src/component.h index 2cbdc9d..b81dbee 100644 --- a/src/component.h +++ b/src/component.h
@@ -2,6 +2,10 @@
2#define COMPONENT_H_F0CE4573 2#define COMPONENT_H_F0CE4573
3 3
4class Component { 4class Component {
5public:
6
7 virtual ~Component() = default;
8
5}; 9};
6 10
7#endif /* end of include guard: COMPONENT_H_F0CE4573 */ 11#endif /* end of include guard: COMPONENT_H_F0CE4573 */