当前位置: 首页>>代码示例>>C++>>正文


C++ CreatureObject::GetStateBitmask方法代码示例

本文整理汇总了C++中CreatureObject::GetStateBitmask方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureObject::GetStateBitmask方法的具体用法?C++ CreatureObject::GetStateBitmask怎么用?C++ CreatureObject::GetStateBitmask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CreatureObject的用法示例。


在下文中一共展示了CreatureObject::GetStateBitmask方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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))
		{
			LOG(info) << "EVState::validate :: states Mask" << cmdProperties->mStates << " creature : " << creature->GetStateBitmask();
			reply1 = kCannotDoWhileState;
			reply2 = this->mController->getLowestCommonBit(creature->GetStateBitmask(), cmdProperties->mStates);
			return false;
		}
		//command_table.deny_in_locomotion
		if (cmdProperties->mLocomotionMask !=0 && ((cmdProperties->mLocomotionMask & creature->states.getLocomotion()) != 0))
		{
			LOG(info) << "EVState::validate :: Locomotion Mask" << cmdProperties->mLocomotionMask << " creature : " << creature->states.getLocomotion();
			reply1 = kCannotDoWhileLocomotion;
			reply2 = mController->getPostureValidator(creature->states.getLocomotion());
			return false;
		}
	}
    return true;
}
开发者ID:ELMERzark,项目名称:mmoserver,代码行数:26,代码来源:EVState.cpp

示例2: 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;
}
开发者ID:ELMERzark,项目名称:mmoserver,代码行数:22,代码来源:PVState.cpp


注:本文中的CreatureObject::GetStateBitmask方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。