/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/sgx/core/gamecode/engine.cpp

*/

#include "sgx/core/core.hpp"


void
CSGXEngine::initialize()
{
	CSGXBaseEngine::initialize();
	CSGXHappening::get()->addEngine(this);
}

void
CSGXEngine::release()
{
	CSGXBaseEngine::release();
	CSGXHappening::get()->removeEngine(this);
}

tBOOL 
CSGXEngine::registerScenarioObject(CGameHandler *ptr)
{
	sgxAssert(find(m_ScenarioObjects.begin(), m_ScenarioObjects.end(), ptr) == m_ScenarioObjects.end());

	CSGXBaseEngine::registerScenarioObject(ptr);

	// *All* engine objects are added to the management engine's master list
	CSGXManagementEngine::get()->registerScenarioObject(ptr);
	return TRUE;
}

tBOOL 
CSGXEngine::unregisterScenarioObject(CGameHandler *ptr)
{
	// *All* engine objects are added to the management engine's master list
	CSGXManagementEngine::get()->unregisterScenarioObject(ptr);

	return CSGXBaseEngine::unregisterScenarioObject(ptr);
}
