本文整理汇总了C++中Actor函数的典型用法代码示例。如果您正苦于以下问题:C++ Actor函数的具体用法?C++ Actor怎么用?C++ Actor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Actor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_schedule
void CPolterTele::update_schedule()
{
inherited::update_schedule();
if (!m_object->g_Alive() || !Actor() || !Actor()->g_Alive()) return;
if (Actor()->Position().distance_to(m_object->Position()) > m_pmt_distance) return;
switch (m_state) {
case eStartRaiseObjects:
if (m_time + m_time_next < time()) {
if (!tele_raise_objects())
m_state = eRaisingObjects;
m_time = time();
m_time_next = m_pmt_raise_time_to_wait_in_objects / 2 + Random.randI(m_pmt_raise_time_to_wait_in_objects / 2);
}
if (m_state == eStartRaiseObjects) {
if (m_object->CTelekinesis::get_objects_count() >= m_pmt_object_count) {
m_state = eRaisingObjects;
m_time = time();
}
}
break;
case eRaisingObjects:
if (m_time + m_pmt_time_to_hold > time()) break;
m_time = time();
m_time_next = 0;
m_state = eFireObjects;
case eFireObjects:
if (m_time + m_time_next < time()) {
tele_fire_objects ();
m_time = time();
m_time_next = m_pmt_time_to_wait_in_objects / 2 + Random.randI(m_pmt_time_to_wait_in_objects / 2);
}
if (m_object->CTelekinesis::get_objects_count() == 0) {
m_state = eWait;
m_time = time();
}
break;
case eWait:
if (m_time + m_pmt_time_to_wait < time()) {
m_time_next = 0;
m_state = eStartRaiseObjects;
}
break;
}
}
示例2: check_start_conditions
bool CControllerPsyHit::check_start_conditions()
{
if (is_active()) return false;
if (m_man->is_captured_pure()) return false;
if (Actor()->Cameras().GetCamEffector(eCEControllerPsyHit))
return false;
if (m_object->Position().distance_to(Actor()->Position()) < m_min_tube_dist)
return false;
return true;
}
示例3: get_actor_ranking
int get_actor_ranking()
{
std::sort (g_all_statistic_humans.begin(),g_all_statistic_humans.end(),GreaterRankPred);
CSE_ALifeTraderAbstract* pActorAbstract = ch_info_get_from_id(Actor()->ID());
SStatData d;
d.id = Actor()->ID();
d.trader = pActorAbstract;
TOP_LIST::iterator it = std::find(g_all_statistic_humans.begin(),g_all_statistic_humans.end(),d);
if(it!=g_all_statistic_humans.end())
return (int)std::distance(g_all_statistic_humans.begin(), it);
else
return 1;
}
示例4: inherited
CPPEffectorControllerAura::CPPEffectorControllerAura(const SPPInfo &ppi, u32 time_to_fade, const ref_sound &snd_left, const ref_sound &snd_right)
: inherited(ppi)
{
m_time_to_fade = time_to_fade;
m_effector_state = eStateFadeIn;
m_time_state_started = Device.dwTimeGlobal;
m_snd_left.clone (snd_left,st_Effect,sg_SourceType);
m_snd_right.clone (snd_right,st_Effect,sg_SourceType);
m_snd_left.play_at_pos (Actor(), Fvector().set(-1.f, 0.f, 1.f), sm_Looped | sm_2D);
m_snd_right.play_at_pos (Actor(), Fvector().set(-1.f, 0.f, 1.f), sm_Looped | sm_2D);
}
示例5: NewActor
Actor NewActor( const Property::Map& map )
{
BaseHandle handle;
// First find type and create Actor
Property::Value* typeValue = map.Find( "type" );
if ( typeValue )
{
TypeInfo type = TypeRegistry::Get().GetTypeInfo( typeValue->Get< std::string >() );
if ( type )
{
handle = type.CreateInstance();
}
}
if ( !handle )
{
DALI_LOG_ERROR( "Actor type not provided\n" );
return Actor();
}
Actor actor( Actor::DownCast( handle ) );
if ( actor )
{
// Now set the properties, or create children
for ( unsigned int i = 0, mapCount = map.Count(); i < mapCount; ++i )
{
const StringValuePair& pair( map.GetPair( i ) );
const std::string& key( pair.first );
if ( key == "type" )
{
continue;
}
const Property::Value& value( pair.second );
if ( key == "actors" )
{
// Create children
Property::Array actorArray = value.Get< Property::Array >();
for ( Property::Array::SizeType i = 0; i < actorArray.Size(); ++i)
{
actor.Add( NewActor( actorArray[i].Get< Property::Map >() ) );
}
}
else
{
Property::Index index( actor.GetPropertyIndex( key ) );
if ( index != Property::INVALID_INDEX )
{
actor.SetProperty( index, value );
}
}
}
}
return actor;
}
示例6: VERIFY
void CUIActorMenu::CheckDistance()
{
CGameObject* pActorGO = smart_cast<CGameObject*>(m_pActorInvOwner);
CGameObject* pPartnerGO = smart_cast<CGameObject*>(m_pPartnerInvOwner);
CGameObject* pBoxGO = smart_cast<CGameObject*>(m_pInvBox);
VERIFY(pActorGO && (pPartnerGO || pBoxGO || m_pCar));
if ( pPartnerGO )
{
if ( ( pActorGO->Position().distance_to( pPartnerGO->Position() ) > 3.0f ) &&
!m_pPartnerInvOwner->NeedOsoznanieMode() )
{
GetHolder()->StartStopMenu( this, true ); // hide actor menu
}
}
else if (m_pCar && Actor()->Holder())
{
//nop
}
else //pBoxGO
{
VERIFY( pBoxGO );
if ( pActorGO->Position().distance_to( pBoxGO->Position() ) > 3.0f )
{
GetHolder()->StartStopMenu( this, true ); // hide actor menu
}
}
}
示例7: Stop
void CActorDeathEffector::Stop()
{
RemoveEffector (Actor(),effActorDeath);
m_death_sound.destroy ();
enable_input ();
show_indicators ();
}
示例8: Actor
void CUITalkWnd::InitTalkDialog()
{
m_pActor = Actor();
if (m_pActor && !m_pActor->IsTalking()) return;
m_pOurInvOwner = smart_cast<CInventoryOwner*>(m_pActor);
m_pOthersInvOwner = m_pActor->GetTalkPartner();
m_pOurDialogManager = smart_cast<CPhraseDialogManager*>(m_pOurInvOwner);
m_pOthersDialogManager = smart_cast<CPhraseDialogManager*>(m_pOthersInvOwner);
//имена собеседников
UITalkDialogWnd->UICharacterInfoLeft.InitCharacter (m_pOurInvOwner->object_id());
UITalkDialogWnd->UICharacterInfoRight.InitCharacter (m_pOthersInvOwner->object_id());
//. UITalkDialogWnd->UIDialogFrame.UITitleText.SetText (m_pOthersInvOwner->Name());
//. UITalkDialogWnd->UIOurPhrasesFrame.UITitleText.SetText (m_pOurInvOwner->Name());
//очистить лог сообщений
UITalkDialogWnd->ClearAll();
InitOthersStartDialog ();
NeedUpdateQuestions ();
Update ();
UITalkDialogWnd->mechanic_mode = m_pOthersInvOwner->SpecificCharacter().upgrade_mechanic();
UITalkDialogWnd->SetOsoznanieMode (m_pOthersInvOwner->NeedOsoznanieMode());
UITalkDialogWnd->Show ();
UITalkDialogWnd->UpdateButtonsLayout(b_disable_break, m_pOthersInvOwner->IsTradeEnabled());
}
示例9: Game
void CChangeLevelWnd::OnCancel()
{
Game().StartStopMenu (this, true);
if(m_b_position_cancel){
Actor()->MoveActor(m_position_cancel, m_angles_cancel);
}
}
示例10: Actor
void CControllerPsyHit::deactivate()
{
m_man->release_pure (this);
m_man->unsubscribe (this, ControlCom::eventAnimationEnd);
if (m_blocked) {
NET_Packet P;
Actor()->u_EventGen (P, GEG_PLAYER_WEAPON_HIDE_STATE, Actor()->ID());
P.w_u32 (INV_STATE_BLOCK_ALL);
P.w_u8 (u8(false));
Actor()->u_EventSend(P);
}
set_sound_state (eNone);
}
示例11: _min
void CUILogsWnd::PerformWork()
{
if(!m_news_in_queue.empty())
{
u32 count = _min(30, m_news_in_queue.size());
//. u32 count = m_news_in_queue.size();
for(u32 i=0; i<count;++i)
{
GAME_NEWS_VECTOR& news_vector = Actor()->game_news_registry->registry().objects();
u32 idx = m_news_in_queue.back();
m_news_in_queue.pop_back ();
GAME_NEWS_DATA& gn = news_vector[idx];
AddNewsItem ( gn, NULL );
}
}
/* else
{
s32 cnt = m_items_cache.size()+m_list->GetSize();
if(cnt<1000)
{
for(s32 i=0; i<_min(10,1000-cnt); ++i)
m_items_cache.push_back(CreateItem());
}
}*/
}
示例12: switch
void CInventoryBox::OnEvent(NET_Packet& P, u16 type)
{
inherited::OnEvent (P, type);
switch (type)
{
case GE_OWNERSHIP_TAKE:
{
u16 id;
P.r_u16(id);
CObject* itm = Level().Objects.net_Find(id); VERIFY(itm);
m_items.push_back (id);
itm->H_SetParent (this);
itm->setVisible (FALSE);
itm->setEnabled (FALSE);
}break;
case GE_OWNERSHIP_REJECT:
{
u16 id;
P.r_u16(id);
CObject* itm = Level().Objects.net_Find(id); VERIFY(itm);
xr_vector<u16>::iterator it;
it = std::find(m_items.begin(),m_items.end(),id); VERIFY(it!=m_items.end());
m_items.erase (it);
itm->H_SetParent (NULL,!P.r_eof() && P.r_u8());
if( m_in_use )
{
CGameObject* GO = smart_cast<CGameObject*>(itm);
Actor()->callback(GameObject::eInvBoxItemTake)( this->lua_game_object(), GO->lua_game_object() );
}
}break;
};
}
示例13: IR_OnKeyboardRelease
void CLevel::IR_OnMouseRelease(int btn)
{
IR_OnKeyboardRelease(mouse_button_2_key[btn]);
// Callback for scripting (Cribbledirge).
if (g_actor) Actor()->callback(GameObject::eOnMouseRelease)(btn);
}
示例14: ch_info_get_from_id
void CUIStalkersRankingWnd::FillList()
{
CUIXml uiXml;
uiXml.Load (CONFIG_PATH, UI_PATH,STALKERS_RANKING_XML);
UIList->Clear ();
uiXml.SetLocalRoot (uiXml.NavigateToNode("stalkers_list",0));
if(g_all_statistic_humans.size())
{
CSE_ALifeTraderAbstract* pActorAbstract = ch_info_get_from_id(Actor()->ID());
int actor_place = get_actor_ranking();
int sz = _min(g_all_statistic_humans.size(),20);
for(int i=0; i<sz; ++i){
CSE_ALifeTraderAbstract* pT = (g_all_statistic_humans[i]).trader;
if(pT==pActorAbstract || (i==19&&actor_place>19) ){
AddActorItem (&uiXml, actor_place+1, pActorAbstract);
}else{
AddStalkerItem (&uiXml, i+1, pT);
}
}
UIList->SetSelected (UIList->GetItem(0) );
}else{
CUIStalkerRankingInfoItem* itm = xr_new<CUIStalkerRankingInfoItem>(this);
itm->Init (&uiXml, "no_items", 0);
UIList->AddWindow (itm, true);
}
}
示例15: todo
void CUIActorInfoWnd::FillPointsDetail(const shared_str& id)
{
UIDetailList->Clear ();
CUIXml uiXml;
uiXml.Load (CONFIG_PATH, UI_PATH,ACTOR_STATISTIC_XML);
uiXml.SetLocalRoot (uiXml.NavigateToNode("actor_stats_wnd",0));
string512 path;
sprintf_s (path,"detail_part_%s",id.c_str());
XML_NODE* n = uiXml.NavigateToNode(path,0);
if(!n)
sprintf_s (path,"detail_part_def");
#pragma todo("implement this")
/*
string256 str;
sprintf_s (str,"st_detail_list_for_%s", id.c_str());
UIInfoHeader->GetTitleStatic()->SetTextST (str);
*/
SStatSectionData& section = Actor()-> StatisticMgr().GetSection(id);
vStatDetailData::const_iterator it = section.data.begin();
vStatDetailData::const_iterator it_e = section.data.end();
int _cntr = 0;
string64 buff;
for(;it!=it_e;++it,++_cntr)
{
CUIActorStaticticDetail* itm = xr_new<CUIActorStaticticDetail>();
itm->Init (&uiXml, path, 0);
sprintf_s (buff,"%d.",_cntr);
itm->m_text0->SetText (buff);
itm->m_text1->SetTextST (*CStringTable().translate((*it).key));
itm->m_text1->AdjustHeightToText ();
if( 0==(*it).str_value.size() )
{
sprintf_s (buff,"x%d", (*it).int_count);
itm->m_text2->SetTextST (buff);
sprintf_s (buff,"%d", (*it).int_points);
itm->m_text3->SetTextST (buff);
}else
{
itm->m_text2->SetTextST ((*it).str_value.c_str());
itm->m_text3->SetTextST ("");
}
Fvector2 sz = itm->GetWndSize();
float _height;
_height = _max(sz.y, itm->m_text1->GetWndPos().y+itm->m_text1->GetWndSize().y+3);
sz.y = _height;
itm->SetWndSize (sz);
UIDetailList->AddWindow (itm, true);
}
}