/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     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: src/sgx/core/gamecode/managementengine.cpp

*/

#include "sgx/core/core.hpp"

CSGXManagementEngine *CSGXManagementEngine::m_pSingleton = NULL;

CSGXManagementEngine *CSGXManagementEngine::create()
{
	m_pSingleton = new CSGXManagementEngine();
	if (m_pSingleton) {
		m_pSingleton->initialize();
	}
	return m_pSingleton;
}

CSGXManagementEngine *CSGXManagementEngine::get()
{
	if (!m_pSingleton) {
		return create();
	}
	return m_pSingleton;
}


tBOOL 
CSGXManagementEngine::registerObject(CGameHandler *ptr)
{
	if (find(m_EngineObjects.begin(), m_EngineObjects.end(), ptr) == m_EngineObjects.end()) {
		return CSGXBaseEngine::registerObject(ptr);
	}
	return FALSE;
}

