本文整理汇总了C++中CreatureObject::GetPosture方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureObject::GetPosture方法的具体用法?C++ CreatureObject::GetPosture怎么用?C++ CreatureObject::GetPosture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreatureObject
的用法示例。
在下文中一共展示了CreatureObject::GetPosture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validate
bool PVState::validate(uint32 &reply1, uint32 &reply2, uint64 targetId, uint32 opcode, ObjectControllerCmdProperties*& cmdProperties)
{
CreatureObject* creature = dynamic_cast<CreatureObject*>(mController->getObject());
// if this command doesn't require state checks skip it, otherwise check our states
if(creature && cmdProperties && (cmdProperties->mStates != 0) && (creature->GetStateBitmask() & cmdProperties->mStates) != 0)
{
if(creature->states.checkStates(cmdProperties->mStates))
{
reply1 = kCannotDoWhileState;
reply2 = mController->getLowestCommonBit(creature->GetStateBitmask(), cmdProperties->mStates);
return false;
}
if (cmdProperties->mPostureMask !=0 && ((cmdProperties->mPostureMask & creature->GetPosture()) != 0))
{
reply1 = kCannotDoWhileLocomotion;
reply2 = mController->getPostureValidator(creature->states.getLocomotion());
return false;
}
}
return true;
}
示例2: validate
bool EVState::validate(uint32 &reply1, uint32 &reply2, uint64 targetId, uint32 opcode, ObjectControllerCmdProperties*& cmdProperties)
{
CreatureObject* creature = dynamic_cast<CreatureObject*>(mController->getObject());
if(creature && cmdProperties)
{
//gLogger->log(LogManager::DEBUG, "locomotionMask(%u) & creature->getLocomotion (%u) ==%u",
//cmdProperties->mLocomotionMask,mController->getLocoValidator(creature->states.getLocomotion()), cmdProperties->mLocomotionMask & creature->states.getLocomotion());
// skip over commands with no state requirement and check the rest
if((cmdProperties->mStates != 0) && creature->states.checkStates(cmdProperties->mStates))
{
reply1 = kCannotDoWhileState;
reply2 = this->mController->getLowestCommonBit(creature->states.getAction(), cmdProperties->mStates);
return false;
}
if (cmdProperties->mLocomotionMask !=0 && ((cmdProperties->mLocomotionMask & creature->GetPosture()) != 0))
{
reply1 = kCannotDoWhileLocomotion;
reply2 = mController->getPostureValidator(creature->states.getLocomotion());
return false;
}
}
return true;
}