/*
   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