本文整理汇总了C++中CEntityAlive::ID方法的典型用法代码示例。如果您正苦于以下问题:C++ CEntityAlive::ID方法的具体用法?C++ CEntityAlive::ID怎么用?C++ CEntityAlive::ID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEntityAlive
的用法示例。
在下文中一共展示了CEntityAlive::ID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VERIFY
void CInventoryOwner::SetCommunity (CHARACTER_COMMUNITY_INDEX new_community)
{
CEntityAlive* EA = smart_cast<CEntityAlive*>(this); VERIFY(EA);
CSE_Abstract* e_entity = ai().alife().objects().object(EA->ID(), false);
if(!e_entity) return;
CSE_ALifeTraderAbstract* trader = smart_cast<CSE_ALifeTraderAbstract*>(e_entity);
if(!trader) return;
CharacterInfo().m_CurrentCommunity.set(new_community);
// EA->id_Team = CharacterInfo().m_CurrentCommunity.team();
EA->ChangeTeam(CharacterInfo().m_CurrentCommunity.team(), EA->g_Squad(), EA->g_Group());
trader->m_community_index = new_community;
}
示例2: Update
void CUIInventoryWnd::Update()
{
if(m_b_need_reinit)
InitInventory ();
CEntityAlive *pEntityAlive = smart_cast<CEntityAlive*>(Level().CurrentEntity());
if(pEntityAlive)
{
float v = pEntityAlive->conditions().GetHealth()*100.0f;
UIProgressBarHealth.SetProgressPos (v);
v = pEntityAlive->conditions().GetPsyHealth()*100.0f;
UIProgressBarPsyHealth.SetProgressPos (v);
v = pEntityAlive->conditions().GetRadiation()*100.0f;
UIProgressBarRadiation.SetProgressPos (v);
if (GameID() != GAME_SINGLE){
game_PlayerState* ps = Game().GetPlayerByGameID(pEntityAlive->ID());
if (ps)
UIProgressBarRank.SetProgressPos(ps->experience_D*100);
}
// update money
CInventoryOwner* pOurInvOwner = smart_cast<CInventoryOwner*>(pEntityAlive);
string64 sMoney;
sprintf (sMoney,"%d RU", pOurInvOwner->get_money());
UIMoneyWnd.SetText (sMoney);
// update outfit parameters
CCustomOutfit* outfit = smart_cast<CCustomOutfit*>(pOurInvOwner->inventory().m_slots[OUTFIT_SLOT].m_pIItem);
UIOutfitInfo.Update (outfit);
}
//. UITimeWnd.Update ();
UIStaticTimeString.SetText(*InventoryUtilities::GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes));
CUIWindow::Update ();
}