From 28ba97bdd8fb6ca352dc49dba01a66bd155ad523 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 15 Nov 2008 19:24:55 +0000 Subject: entity extensions --- src/core/extension.cc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/core/extension.cc (limited to 'src/core/extension.cc') 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 + -- cgit v1.2.3