Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-11-15 19:24:55 +0000
committerStijn Buys <ingar@osirion.org>2008-11-15 19:24:55 +0000
commit28ba97bdd8fb6ca352dc49dba01a66bd155ad523 (patch)
treeeb4abd0505eb842e15201783529814bda1ae6e76 /src/core/extension.cc
parent1f0dbeeabdffff096908473168898c5fa63bcff0 (diff)
entity extensions
Diffstat (limited to 'src/core/extension.cc')
-rw-r--r--src/core/extension.cc29
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
+