本文整理汇总了C++中CSystem::GetPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ CSystem::GetPlayer方法的具体用法?C++ CSystem::GetPlayer怎么用?C++ CSystem::GetPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSystem
的用法示例。
在下文中一共展示了CSystem::GetPlayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
CSpaceObject *CDamageSource::GetObj (void) const
// GetObj
//
// Returns the source object
{
CSpaceObject *pOrderGiver;
// If the source is the player then always return the player
// object (regardless of m_pSource). We do this in case
// the player changes ships.
if (m_dwFlags & FLAG_IS_PLAYER)
{
CSystem *pSystem = g_pUniverse->GetCurrentSystem();
return (pSystem ? pSystem->GetPlayer() : NULL);
}
// Otherwise, if we're a subordinate and our order giver
// has changed, switch back to the player.
else if ((m_dwFlags & FLAG_IS_PLAYER_SUBORDINATE)
&& (m_pSource == NULL
|| (pOrderGiver = m_pSource->GetOrderGiver()) == NULL
|| !pOrderGiver->IsPlayer()))
{
CSystem *pSystem = g_pUniverse->GetCurrentSystem();
return (pSystem ? pSystem->GetPlayer() : NULL);
}
// Otherwise, return the source (even if NULL)
else
return m_pSource;
}