本文整理汇总了C++中Opt::SetEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ Opt::SetEnabled方法的具体用法?C++ Opt::SetEnabled怎么用?C++ Opt::SetEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opt
的用法示例。
在下文中一共展示了Opt::SetEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessPending
bool SetOwnershipMessageHandlerSubSystem::ProcessPending( Message const& message )
{
SetOwnershipMessage const& msg = static_cast<SetOwnershipMessage const&>( message );
Opt<Actor> actor = mScene.GetActor( msg.mActorGUID ); //guaranteed
L1( "executing %s: actorGUID %d \n", __FUNCTION__, msg.mActorGUID );
Opt<PlayerControllerComponent> playerControllerC( actor->Get<IControllerComponent>() );
if ( !playerControllerC.IsValid() )
{
L1( "setownership is called on an actor that is not playerControllable \n" );
return true;
}
playerControllerC->mControllerId = msg.mClientId;
if ( msg.mClientId == mProgramState.mClientId )
{
L1( "thats my id! actorguid: %d,%d \n", msg.mActorGUID, PlayerControllerComponent::GetType_static() );
Opt<Actor> oldActor = mScene.GetActor( mProgramState.mControlledActorGUID );
if ( oldActor.IsValid() )
{
Opt<PlayerControllerComponent> pcc = oldActor->Get<IControllerComponent>();
if( pcc.IsValid() )
{
pcc->SetEnabled( false );
pcc->mActive = false;
}
}
mProgramState.mControlledActorGUID = msg.mActorGUID;
playerControllerC->SetEnabled( true );
playerControllerC->mActive = true;
mScene.SetPlayerModels( actor );
}
Opt<core::ClientData> clientData( mProgramState.FindClientDataByClientId( msg.mClientId ) );
if ( clientData.IsValid() )
{
clientData->mClientActorGUID = msg.mActorGUID;
}
return true;
}