本文整理汇总了C++中People::GetParentID方法的典型用法代码示例。如果您正苦于以下问题:C++ People::GetParentID方法的具体用法?C++ People::GetParentID怎么用?C++ People::GetParentID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::GetParentID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteOwner
void ROOM_SPACE::DeleteOwner(People& p)
{
ePipeline& OwnerInfo = GetOwnerInfo();
ePipeline& OwnerList = *(ePipeline*)OwnerInfo.GetData(REG_OWNER_LIST);
for (int i=0; i<OwnerInfo.Size();i++)
{
ePipeline* Owner = (ePipeline*)OwnerList.GetData(i);
tstring& Cryptograph = *(tstring*)Owner->GetData(2);
if (Cryptograph == p.m_Cryptograhp)
{
OwnerList.EraseEnergy(i,1);
return ;
}
}
if(p.GetParentID() == GetSpaceID()){
p.GoOut();
//这里应该有更多处理,p被赶出此空间,那么应该退回到上一个空间
assert(0);
return;
}
}
示例2: AllowInto
bool ROOM_SPACE::AllowInto(People& p){
if (!IsValid())
{
return false;
}
//如果已经在此空间则直接返回
if(p.GetParentID() == m_ID)return true;
int64 ChildID = 0;
ePipeline& OwnerInfo = GetOwnerInfo();
SPACE_RIGHT RoomRight = *(SPACE_RIGHT*)OwnerInfo.GetData(REG_RIGHT);
ePipeline& OwnerList = *(ePipeline*)OwnerInfo.GetData(REG_OWNER_LIST);
for (int i=0; i<OwnerList.Size();i++)
{
ePipeline* Owner = (ePipeline*)OwnerList.GetData(i);
tstring& Cryptograph = *(tstring*)Owner->GetData(2);
if (Cryptograph == p.m_Cryptograhp)
{
SPACE_RIGHT Right = *(SPACE_RIGHT*)Owner->GetData(1);
if(Right >= RoomRight){
return true;
}
break;
}
}
//访问者不是固定注册的拥有者,但只要当前空间不禁止参观也可以进入
bool Allow = false;
switch(RoomRight)
{
case NO_RIGHT:
{ //能够访问,robot的访问权限保持不变
Allow = true;
}
break;
case VISIT_ONLY:
{
Allow = true;
}
break;
case VISIT_NOTIFY:
{
//通知其它人,暂时没有实现
assert(0);
}
break;
case VISIT_APPLY:
{
//提出申请,暂时没有实现
assert(0);
}
case USABLE:
{
Allow = true;
}
break;
case USABLE_NOTIFY:
{
//通知其它人,暂时没有实现
assert(0);
}
break;
case USABLE_APPLY:
{
//提出申请,暂时没有实现
assert(0);
}
break;
case HOLD_NOTIFY:
{
//通知其它人,暂时没有实现
assert(0);
}
break;
case HOLD_APPLY:
{
//提出申请,暂时没有实现
assert(0);
}
break;
case RIGHT_HOLD:
{
//显然不允许
}
break;
}
return Allow;
}