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


C++ BaseClass::EngineMessageFn方法代码示例

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


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

示例1: EngineMessageFn

uint32 Body::EngineMessageFn(uint32 messageID, void *pData, LTFLOAT fData)
{
	switch(messageID)
	{
		case MID_UPDATE:
		{
			uint32 dwRet = Prop::EngineMessageFn(messageID, pData, fData);

			Update();

			return dwRet;
		}
		break;

		case MID_LINKBROKEN :
		{
			HOBJECT hObject = (HOBJECT)pData;
			HATTACHMENT hAttachment = LTNULL;

			if ( LT_OK == g_pLTServer->FindAttachment(m_hObject, hObject, &hAttachment) )
			{
				if ( LT_OK == g_pLTServer->RemoveAttachment(hAttachment) )
				{

				}
			}

			if ( m_hChecker == hObject )
			{
				m_hChecker = LTNULL;
			}

			if ( m_hWeaponItem == hObject )
			{
				m_hWeaponItem = LTNULL;
			}

			for ( uint32 iSpear = 0 ; iSpear < kMaxSpears ; iSpear++ )
			{
				if ( m_ahSpears[iSpear] == hObject )
				{
					m_ahSpears[iSpear] = LTNULL;
				}
			}

			break;
		}

		case MID_MODELSTRINGKEY:
		{
			HandleModelString((ArgList*)pData);
		}
		break;

		case MID_INITIALUPDATE:
		{
			uint32 dwRet = Prop::EngineMessageFn(messageID, pData, fData);

			// Set up the animator

			m_Animator.Init(m_hObject);

            SetNextUpdate(s_fUpdateDelta);

            uint32 dwUsrFlags = g_pLTServer->GetObjectUserFlags(m_hObject);
            g_pLTServer->SetObjectUserFlags(m_hObject, dwUsrFlags | USRFLG_NIGHT_INFRARED);

			return dwRet;
		}
		break;

		case MID_TOUCHNOTIFY:
		{
			HOBJECT hObject = (HOBJECT)pData;

			if ( IsPlayer(hObject) )
			{
				if ( m_hWeaponItem )
				{
					BaseClass* pWeaponItem = (BaseClass*)g_pLTServer->HandleToObject(m_hWeaponItem);
					pWeaponItem->EngineMessageFn(messageID, pData, fData);
				}

				for ( uint32 iSpear = 0 ; iSpear < m_cSpears ; iSpear++ )
				{
					if ( m_ahSpears[iSpear] )
					{
						BaseClass* pSpear = (BaseClass*)g_pLTServer->HandleToObject(m_ahSpears[iSpear]);
						pSpear->EngineMessageFn(messageID, pData, fData);
					}
				}
			}

			if ( m_pState )
			{
				m_pState->HandleTouch(hObject);
			}
		}
		break;

//.........这里部分代码省略.........
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:101,代码来源:Body.cpp


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