本文整理汇总了C++中CGameManager::GetCurrentPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameManager::GetCurrentPlayer方法的具体用法?C++ CGameManager::GetCurrentPlayer怎么用?C++ CGameManager::GetCurrentPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameManager
的用法示例。
在下文中一共展示了CGameManager::GetCurrentPlayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageProc
//.........这里部分代码省略.........
}
if (pSMSG->GetEffects().size() != 0)
{
for (unsigned int i = 0; i < pSMSG->GetEffects().size(); ++i)
{
pUnit->PushEffect(CAbilityManager::GetInstance()->GetAbility(pSMSG->GetEffects()[i]),1);
}
}
}
}
break;
case MSG_DESPAWNUNIT:
{
CDespawnUnitMessage* pSMSG = dynamic_cast<CDespawnUnitMessage*>(pMsg);
if (CGameplayState::GetInstance()->GetSelectedUnit() == pSMSG->GetUnit())
{
CGameplayState::GetInstance()->ClearSelections();
}
CTile* tile = CTileManager::GetInstance()->GetTile(pSMSG->GetUnit()->GetPos().nPosX, pSMSG->GetUnit()->GetPos().nPosY);
int nUnitID = pSMSG->GetUnit()->GetUniqueID();
if (tile != nullptr)
{
tile->SetIfOccupied(false);
if (pSMSG->GetUnit()->GetType() != UT_SKELETON)
tile->SetIfDeadTile(true);
}
if (pSMSG->GetUnit() == CGameplayState::GetInstance()->GetHighlighted())
CGameplayState::GetInstance()->ClearHighlighted();
CObjectManager::GetInstance()->RemoveObject(pSMSG->GetUnit());
if(pSMSG->GetUnit()->GetType() == UT_HERO || pSMSG->GetUnit()->GetType() == UT_CASTLE)
{
if(pThis->GetCurrentPlayer()->GetAI())
{
CGameOverState::GetInstance()->SetAI(true);
}
else
{
CGameOverState::GetInstance()->SetAI(false);
if(pSMSG->GetUnit()->GetPlayerID() == 0)
CGameOverState::GetInstance()->SetPlayer(2);
else if(pSMSG->GetUnit()->GetPlayerID() == 1)
CGameOverState::GetInstance()->SetPlayer(1);
}
CStateStack::GetInstance()->Push(CGameOverState::GetInstance());
}
if (pSMSG->GetUnit()->GetPlayerID() != pThis->GetCurrentPlayer()->GetPlayerID())
{
pThis->GetCurrentPlayer()->SetExp(pThis->GetCurrentPlayer()->GetExp() + (pSMSG->GetUnit()->GetEXPValue()*3));
pThis->GetCurrentPlayer()->GetStats()->nPlayerEXPEarned+=pSMSG->GetUnit()->GetEXPValue();
switch (pSMSG->GetUnit()->GetType())
{
case UT_SWORDSMAN:
pThis->GetCurrentPlayer()->GetStats()->nSwordsmanKilled++;
break;
case UT_ARCHER:
pThis->GetCurrentPlayer()->GetStats()->nArcherKilled++;
break;
case UT_CAVALRY:
pThis->GetCurrentPlayer()->GetStats()->nCavalryKilled++;
break;
}
}