本文整理汇总了C++中CGameObject::cName方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameObject::cName方法的具体用法?C++ CGameObject::cName怎么用?C++ CGameObject::cName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameObject
的用法示例。
在下文中一共展示了CGameObject::cName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Affect
void CRadioactiveZone::Affect(SZoneObjectInfo* O)
{
// вермя срабатывания не чаще, чем заданный период
if(m_dwDeltaTime < m_dwPeriod) return;
//. m_dwDeltaTime = 0;
CGameObject *GO = O->object;
if(GO)
{
Fvector pos;
XFORM().transform_tiny(pos,CFORM()->getSphere().P);
#ifdef DEBUG
char pow[255];
sprintf(pow, "zone hit. %.3f", Power(GO->Position().distance_to(pos)));
if(bDebug) Msg("%s %s", *GO->cName(), pow);
#endif
Fvector dir;
dir.set(0,0,0);
Fvector position_in_bone_space;
float power = (GameID() == GAME_SINGLE) ? Power(GO->Position().distance_to(pos)) : 0.0f;
float impulse = 0.f;
if(power > EPS)
{
//. m_dwDeltaTime = 0;
position_in_bone_space.set(0.f,0.f,0.f);
CreateHit(GO->ID(),ID(),dir,power,BI_NONE,position_in_bone_space,impulse,ALife::eHitTypeRadiation);
}
}
}
示例2:
u32 CLevel::Objects_net_Save (NET_Packet* _Packet, u32 start, u32 max_object_size)
{
NET_Packet& Packet = *_Packet;
u32 position;
for (; start<Objects.o_count(); start++) {
CObject *_P = Objects.o_get_by_iterator(start);
CGameObject *P = smart_cast<CGameObject*>(_P);
// Msg ("save:iterating:%d:%s",P->ID(),*P->cName());
if (P && !P->getDestroy() && P->net_SaveRelevant()) {
Packet.w_u16 (u16(P->ID()) );
Packet.w_chunk_open16 (position);
// Msg ("save:saving:%d:%s",P->ID(),*P->cName());
P->net_Save (Packet);
#ifdef DEBUG
u32 size = u32 (Packet.w_tell()-position)-sizeof(u16);
// Msg ("save:saved:%d bytes:%d:%s",size,P->ID(),*P->cName());
if (size>=65536) {
Debug.fatal (DEBUG_INFO,"Object [%s][%d] exceed network-data limit\n size=%d, Pend=%d, Pstart=%d",
*P->cName(), P->ID(), size, Packet.w_tell(), position);
}
#endif
Packet.w_chunk_close16 (position);
// if (0==(--count))
// break;
if (max_object_size > (NET_PacketSizeLimit - Packet.w_tell()))
break;
}
}
return ++start;
}