diff options
author | Stijn Buys <ingar@osirion.org> | 2008-11-15 19:24:55 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-11-15 19:24:55 +0000 |
commit | 28ba97bdd8fb6ca352dc49dba01a66bd155ad523 (patch) | |
tree | eb4abd0505eb842e15201783529814bda1ae6e76 /src/core/extension.cc | |
parent | 1f0dbeeabdffff096908473168898c5fa63bcff0 (diff) |
entity extensions
Diffstat (limited to 'src/core/extension.cc')
-rw-r--r-- | src/core/extension.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/core/extension.cc b/src/core/extension.cc new file mode 100644 index 0000000..7106fa5 --- /dev/null +++ b/src/core/extension.cc @@ -0,0 +1,29 @@ +/* + core/extension.cc + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#include "core/extension.h" + +namespace core +{ + +Extension::Extension(Type type, Entity *entity) +{ + extension_entity = entity; + extension_type = type; + + if (entity) + entity->entity_extension[(size_t) type] = this; +} + +Extension::~Extension() +{ + if (extension_entity) + extension_entity->entity_extension[(size_t) extension_type] = 0; +} + + +} // namespace core + |