当前位置: 首页>>代码示例>>C++>>正文


C++ IObject::GetObjectId方法代码示例

本文整理汇总了C++中IObject::GetObjectId方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::GetObjectId方法的具体用法?C++ IObject::GetObjectId怎么用?C++ IObject::GetObjectId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObject的用法示例。


在下文中一共展示了IObject::GetObjectId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetTree

	virtual IBehaviorTree* GetTree( const char* name )
	{
		IBehaviorTree* pTree = NULL;

		TTreeMap::iterator it = m_trees.find(name);
		if (it != m_trees.end())
		{
			IObjectUtils::GetObject( &pTree, it->second );
		}
		else
		{
			IObject* pObj = IObjectUtils::CreateUniqueObject( name );
			if (pObj)
			{
				IObjectUtils::GetObject( &pTree, pObj->GetObjectId() );
			}
			
			if (pTree)
			{
				m_trees[name] = pTree->GetObjectId();
			}		
		}

		return pTree;
	}
开发者ID:ruanjian0503,项目名称:RuntimeCompiledCPlusPlus,代码行数:25,代码来源:BehaviorTreeManager.cpp

示例2: Init

bool ConsoleGame::Init()
{
	//Initialise the RuntimeObjectSystem
	m_pRuntimeObjectSystem = new RuntimeObjectSystem;
	m_pCompilerLogger = new StdioLogSystem();
	if( !m_pRuntimeObjectSystem->Initialise(m_pCompilerLogger, 0) )
    {
        m_pRuntimeObjectSystem = 0;
        return false;
    }
	m_pRuntimeObjectSystem->GetObjectFactorySystem()->AddListener(this);


	// construct first object
	IObjectConstructor* pCtor = m_pRuntimeObjectSystem->GetObjectFactorySystem()->GetConstructor( "RuntimeObject01" );
	if( pCtor )
	{
		IObject* pObj = pCtor->Construct();
		pObj->GetInterface( &m_pUpdateable );
		if( 0 == m_pUpdateable )
		{
			delete pObj;
			m_pCompilerLogger->LogError("Error - no updateable interface found\n");
			return false;
		}
		m_ObjectId = pObj->GetObjectId();

	}

	return true;
}
开发者ID:Ashalah,项目名称:RuntimeCompiledCPlusPlus,代码行数:31,代码来源:ConsoleGame.cpp

示例3: SetBehavior

	virtual void SetBehavior( const char* behavior )
	{
		if (!m_pBehavior || _stricmp(behavior, m_pBehavior->GetTypeName()))
		{
			IBehavior* pBehavior = 0;
			IObject* pObj = IObjectUtils::CreateObject( behavior );
			if (pObj)
			{
				IObjectUtils::GetObject( &pBehavior, pObj->GetObjectId() );
			}
			
			// Only destroy and replace existing behavior if we successfully created new one
			if (pBehavior)
			{
				if (m_pBehavior)
				{
					m_pBehavior->EndBehavior();
					delete m_pBehavior;
				}
				
				m_pBehavior = pBehavior;
				m_pBehavior->SetGameObject(this);
				m_pBehavior->StartBehavior();
			}
		}
	}
开发者ID:jeffora,项目名称:RuntimeCompiledCPlusPlus,代码行数:26,代码来源:GameObject.cpp

示例4: DoSpawnGameObject

	IGameObject* DoSpawnGameObject( const GameObjectSpawnParams& params )
	{
		IGameObject* pGameObject = 0;
		EGameObject type = params.type;

		if (type < EGO_COUNT)
		{
			std::string name = m_GlobalParameters.go[type].base_name;
			char buff[16];
            _snprintf_s(buff, sizeof(buff), _TRUNCATE, "%d",++(m_NextGameObjectNumber[type]));
			name += buff;

			IObject* pObj = IObjectUtils::CreateObjectAndEntity( "GameObject", name.c_str() );
			IObjectUtils::GetObject( &pGameObject, pObj->GetObjectId() );

			AUVec3f pos = (params.spawnPosition.IsInfinite()) ? GetSpawnPosition(type) : params.spawnPosition;
			pGameObject->Init(type, pos);
			m_GameObjects[type].insert(pGameObject);
		}

		// Notify any listeners that object was created
		for (size_t i=0; i<m_Listeners.size(); ++i)
		{
			m_Listeners[i]->OnGameObjectCreated(pGameObject);
		}

		return pGameObject;
	}
开发者ID:ABuus,项目名称:RuntimeCompiledCPlusPlus,代码行数:28,代码来源:GameManager.cpp

示例5: CreateSplashScreen

	void CreateSplashScreen( const char* file, float fMinTime, float fFadeInTime, float fFadeOutTime, bool bAutoClose )
	{
		DestroySplashScreen();

		IObject* pObj = IObjectUtils::CreateObjectAndEntity( "SplashScreen", "SplashScreen" );
		IObjectUtils::GetObject( &m_pSplashScreen, pObj->GetObjectId() );
		m_pSplashScreen->SetImage(file);
		m_pSplashScreen->SetMinViewTime(fMinTime);
		m_pSplashScreen->SetFadeInTime(fFadeInTime);
		m_pSplashScreen->SetFadeOutTime(fFadeOutTime);
		m_pSplashScreen->SetAutoClose(bAutoClose);
	}
开发者ID:ABuus,项目名称:RuntimeCompiledCPlusPlus,代码行数:12,代码来源:GameManager.cpp

示例6: DoDestroyGameObject

	void DoDestroyGameObject( ObjectId id )
	{
		IObjectFactorySystem* pFactory = PerModuleInterface::g_pSystemTable->pObjectFactorySystem;
		IObject* pObj = pFactory->GetObject(id);
		if (pObj)
		{
			IGameObject* pGameObject = 0;
			IObjectUtils::GetObject( &pGameObject, pObj->GetObjectId() );

			// Notify any listeners that object is about to be destroyed
			for (size_t i=0; i<m_Listeners.size(); ++i)
			{
				m_Listeners[i]->OnGameObjectAboutToDestroy(pGameObject);
			}

			m_GameObjects[pGameObject->GetGameObjectType()].erase(pGameObject);
			IObjectUtils::DestroyObjectAndEntity( pGameObject->GetEntityId() );
		}
	}
开发者ID:ABuus,项目名称:RuntimeCompiledCPlusPlus,代码行数:19,代码来源:GameManager.cpp

示例7: setup


//.........这里部分代码省略.........

# ifdef TARGET_LINUX
  rCPP.AddIncludeDir("/usr/include/AL");
  rCPP.AddIncludeDir("/usr/include/cairo");
  rCPP.AddIncludeDir("/usr/include/gtk-3.0");
  rCPP.AddIncludeDir("/usr/include/atk-1.0");
  rCPP.AddIncludeDir("/usr/include/glib-2.0");
  rCPP.AddIncludeDir("/usr/lib/glib-2.0/include/");
  rCPP.AddIncludeDir("/usr/include/harfbuzz");
  rCPP.AddIncludeDir("/usr/include/pixman-1");
  rCPP.AddIncludeDir("/usr/include/libpng12");
  rCPP.AddIncludeDir("/usr/include/pango-1.0");
  rCPP.AddIncludeDir("/usr/include/freetype2");
  rCPP.AddIncludeDir("/usr/include/gio-unix-2.0");
  rCPP.AddIncludeDir("/usr/include/gstreamer-1.0");
  rCPP.AddIncludeDir("/usr/lib/gstreamer-1.0/include");
  rCPP.AddIncludeDir("/usr/lib/gstreamer-1.0/include/gst");
  rCPP.AddIncludeDir("/usr/include/gdk-pixbuf-2.0");
  rCPP.AddIncludeDir("/usr/include/at-spi2-atk/2.0");
  rCPP.AddIncludeDir("/usr/lib/x86_64-linux-gnu/glib-2.0/include");
# endif

  rCPP.AddIncludeDir("../of/src/freeimage");
  rCPP.AddIncludeDir("../of/src/freeimage/OpenEXR");
  rCPP.AddIncludeDir("../of/src/freeimage/OpenEXR/Half");
  rCPP.AddIncludeDir("../of/src/freeimage/OpenEXR/Iex");
  rCPP.AddIncludeDir("../of/src/freeimage/OpenEXR/IlmImf");
  rCPP.AddIncludeDir("../of/src/freeimage/OpenEXR/IlmThread");
  rCPP.AddIncludeDir("../of/src/freeimage/OpenEXR/Imath");
  rCPP.AddIncludeDir("../of/src/rtaudio");
  rCPP.AddIncludeDir("../of/src/rtaudio/include");
  rCPP.AddIncludeDir("../of/src/utf8cpp");
  rCPP.AddIncludeDir("../of/src/utf8cpp/include");
  rCPP.AddIncludeDir("../of/src/utf8cpp/include/utf8");
  rCPP.AddIncludeDir("../of/src/glew");
  rCPP.AddIncludeDir("../of/src/glew/include");
  rCPP.AddIncludeDir("../of/src/glfw");
  rCPP.AddIncludeDir("../of/src/glfw/include");
  rCPP.AddIncludeDir("../of/src/glfw/include/GLFW");
  rCPP.AddIncludeDir("../of/src/kissfft");
  rCPP.AddIncludeDir("../of/src/kissfft/tools");
  rCPP.AddIncludeDir("../of/src/poco");
  rCPP.AddIncludeDir("../of/src/poco/Crypto/include");
  rCPP.AddIncludeDir("../of/src/poco/Foundation/include");
  rCPP.AddIncludeDir("../of/src/poco/Net/include");
  rCPP.AddIncludeDir("../of/src/poco/NetSSL_OpenSSL/include");
  rCPP.AddIncludeDir("../of/src/poco/Util/include");
  rCPP.AddIncludeDir("../of/src/poco/XML/include");
  rCPP.AddIncludeDir("../of/src/poco/Zip/include");
  rCPP.AddIncludeDir("../of/src/rtaudio");
  rCPP.AddIncludeDir("../of/src/rtaudio/include");
  rCPP.AddIncludeDir("../of/src/libtess2");
  rCPP.AddIncludeDir("../of/src/libtess2/Include");
  rCPP.AddIncludeDir("../of/src/libtess2/Sources");
  rCPP.AddIncludeDir("../of/src/openframeworks");
  rCPP.AddIncludeDir("of/src/openframeworks");
  rCPP.AddIncludeDir("../of/src/openframeworks/3d");
  rCPP.AddIncludeDir("../of/src/openframeworks/app");
  rCPP.AddIncludeDir("../of/src/openframeworks/communication");
  rCPP.AddIncludeDir("../of/src/openframeworks/events");
  rCPP.AddIncludeDir("../of/src/openframeworks/gl");
  rCPP.AddIncludeDir("../of/src/openframeworks/graphics");
  rCPP.AddIncludeDir("../of/src/openframeworks/math");
  rCPP.AddIncludeDir("../of/src/openframeworks/sound");
  rCPP.AddIncludeDir("../of/src/openframeworks/types");
  rCPP.AddIncludeDir("../of/src/openframeworks/utils");
  rCPP.AddIncludeDir("../of/src/openframeworks/video");

  rCPP.AddIncludeDir("RuntimeCompiledCPlusPlus/Aurora");
  rCPP.AddIncludeDir("addons/ofxImGui/src");
  rCPP.AddIncludeDir("addons/ofxImGui/libs/imgui/src");
  rCPP.AddIncludeDir("../of/addons/ofxAssimpModelLoader/src");
  rCPP.AddIncludeDir("../of/addons/ofxAssimpModelLoader/libs/assimp/include/");
  rCPP.AddIncludeDir("./");

  {
    ofDirectory dir(ofFilePath::getCurrentExeDir() + "..");
    dir.listDir();
    vector<ofFile> files = dir.getFiles();
    for (ofFile& file : files)
    {
      if (file.isDirectory() &&
          file.getBaseName().substr(0,3) == "ofx")
      {
        rCPP.AddIncludeDir(&(file.path())[0]);
        rCPP.AddIncludeDir(&(file.path() + "/src")[0]);
      }
    }
  }

  rCPP.GetObjectFactorySystem()->AddListener(this);

  {
    IObject* rObject = rCPP.GetObjectFactorySystem()->GetConstructor("ofApp")->Construct();
    rObject->GetInterface(&rAPP);
    rOID = rObject->GetObjectId();
  }

  rAPP->setup();
}
开发者ID:origamidance,项目名称:ofxGeoFramework,代码行数:101,代码来源:ofLive.cpp


注:本文中的IObject::GetObjectId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。