本文整理汇总了C++中CDesignType::GetTypeName方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesignType::GetTypeName方法的具体用法?C++ CDesignType::GetTypeName怎么用?C++ CDesignType::GetTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesignType
的用法示例。
在下文中一共展示了CDesignType::GetTypeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnKeyEvent
void CPlayerGameStats::OnKeyEvent (EEventTypes iType, CSpaceObject *pObj, DWORD dwCauseUNID)
// OnKeyEvent
//
// Adds a key event involving an object
{
ASSERT(pObj);
CSystem *pSystem = pObj->GetSystem();
if (pSystem == NULL)
return;
// Get the NodeID where the event happened
CTopologyNode *pNode = pSystem->GetTopology();
if (pNode == NULL)
return;
const CString &sNodeID = pNode->GetID();
// Get the object's type
CDesignType *pType = pObj->GetType();
if (pType == NULL)
return;
// Get the object's name
DWORD dwNameFlags;
CString sName = pObj->GetName(&dwNameFlags);
// If the object name is the same as the type name then we don't bother
// storing it in the event (to save memory)
if (strEquals(sName, pType->GetTypeName()))
{
sName = NULL_STR;
dwNameFlags = 0;
}
// Look for the list of events for this NodeID
TArray<SKeyEventStats> *pEventList = m_KeyEventStats.Set(sNodeID);
SKeyEventStats *pStats = pEventList->Insert();
pStats->iType = iType;
pStats->dwTime = g_pUniverse->GetTicks();
pStats->dwObjUNID = pObj->GetType()->GetUNID();
pStats->sObjName = sName;
pStats->dwObjNameFlags = dwNameFlags;
pStats->dwCauseUNID = dwCauseUNID;
}