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


C++ TSerialize::EnumValue方法代码示例

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


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

示例1: OnFullSerialize

void CPlayerStateJump::OnFullSerialize( TSerialize ser, CPlayer& player )
{
	ser.BeginGroup( "StateJump" );
	ser.Value( "JumpLock", m_jumpLock );
	if( ser.IsReading() )
	{
		EJumpState state = JState_None;
		ser.EnumValue( "jumpState", state, JState_None, JState_Total );
		SetJumpState( player, state );
	}
	else
	{
		ser.EnumValue( "jumpState", m_jumpState, JState_None, JState_Total );
	}
	ser.EndGroup();
}
开发者ID:aronarts,项目名称:FireNET,代码行数:16,代码来源:PlayerStateJump.cpp

示例2: NetSerialize

bool CNetworkBuilding::NetSerialize( TSerialize ser, EEntityAspects aspect, uint8 profile, int pflags )
{
	if (aspect == POSITION_ASPECT)
	{
		if(gEnv->bServer && !gEnv->IsEditor())
		{
			int cur_state = (int)m_state;
			ws->SetInt(entity_name,"BuildStatus",build_status);
			ws->SetInt(entity_name,"EntityState",cur_state);
		}

		EState newState = m_state;
		ser.EnumValue("cur_state", newState, eState_NotUsed, eState_Done);
		ser.Value( "build_status", build_status);

		if (ser.IsWriting())
		{
			//CryLog("CNetworkBuilding::NetSerialize writing !!!");			
		}

		if (ser.IsReading())
		{
			//CryLog("CNetworkBuilding::NetSerialize reading !!!");
			m_state = newState;
			Building(build_status);
		}
	}

	return true;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:30,代码来源:NetworkBuilding.cpp

示例3: SerializeWith

void SProceduralSpawnRec::SerializeWith(TSerialize ser)
{
	ser.EnumValue("typ", op, eNBO_Create, eNBO_NUM_OPERATIONS);
#define CSER(cond, val) if (BIT(op) & cond) ser.Value(#val, val); else val = -1
	CSER(OPS_WITH_PARTIDS, partid);
	CSER(OPS_REFERENCING_ENTS, idxRef);
	CSER(OPS_CAUSING_ENTS, idx);
#undef CSER
}
开发者ID:aronarts,项目名称:FireNET,代码行数:9,代码来源:ProceduralBreak.cpp

示例4: NetSerialize

//-------------------------------------------------------------------------
bool CGameRulesStandardState::NetSerialize( TSerialize ser, EEntityAspects aspect, uint8 profile, int flags )
{
	if (aspect == STANDARD_STATE_ASPECT)
	{
		EGR_GameState state = m_state;
		ser.EnumValue("state", state, EGRS_Reset, EGRS_MAX);

		if (ser.IsReading())
		{
			m_lastReceivedServerState = state;

			if(!m_pGameRules->IsIntroSequenceCurrentlyPlaying())
			{
				bool bApplyChange = false;

				if(CPlayer * pPlayer = static_cast<CPlayer*>(g_pGame->GetIGameFramework()->GetClientActor()))
				{
					bApplyChange = !pPlayer->ShouldPlayIntro();
				}
				 
				if(bApplyChange)
				{
					if (m_state != m_lastReceivedServerState)
					{
						bool bNeedsCleanUpIntro = false;
						// If we are no longer going to play the intro, cleanup!. Players may not have registered with the HUD etc. Make sure they get a chance to. 
						if(m_state == EGRS_Intro && m_pGameRules->IsIntroSequenceRegistered())
						{
							bNeedsCleanUpIntro = true; 
						}

						CryLog("CGameRulesStandardState::NetSerialize(), state changed from %i to %i", (int)m_state, (int)m_lastReceivedServerState);
						ChangeState(m_lastReceivedServerState);

						if (bNeedsCleanUpIntro)
						{
							CleanUpAbortedIntro();
						}
					}
				}
			}
		}
	}

	return true;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:47,代码来源:GameRulesStandardState.cpp

示例5: FullSerialize

void CLipSyncProvider_TransitionQueue::FullSerialize(TSerialize ser)
{
	ser.BeginGroup("LipSyncProvider_TransitionQueue");

	ser.Value("m_entityId", m_entityId);
	ser.Value("m_nCharacterSlot", m_nCharacterSlot);
	ser.Value("m_nAnimLayer", m_nAnimLayer);
	ser.Value("m_sDefaultAnimName", m_sDefaultAnimName);
	ser.EnumValue("m_state", m_state, eS_Init, eS_Stopped);
	ser.Value("m_isSynchronized", m_isSynchronized);
	ser.Value("m_requestedAnimId", m_requestedAnimId);
	m_requestedAnimParams.Serialize(ser);
	m_cachedAnim.Serialize(ser);
	ser.Value("m_nCurrentAnimationToken", m_nCurrentAnimationToken);
	ser.Value("m_soundId", m_soundId);

	ser.EndGroup();

	if (ser.IsReading())
	{
		m_isSynchronized = false;
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:23,代码来源:LipSync_TransitionQueue.cpp

示例6: Serialize

void CHUDMissionObjective::Serialize(TSerialize ser)
{
	//ser.Value("m_shortMessage", m_shortMessage);
	//ser.Value("m_screenMessage", m_screenMessage);
	//ser.Value("m_id", m_id);

	ser.Value("m_trackedEntity", m_trackedEntity);
	ser.EnumValue("m_eStatus", m_eStatus, FIRST, LAST);
	ser.Value("m_silent", m_silent);
	ser.Value("m_secondary", m_secondary);

	if(ser.IsReading())
	{
		if(m_eStatus != DEACTIVATED)
		{
			m_lastTimeChanged = gEnv->pTimer->GetFrameStartTime().GetSeconds();
		}

		m_pMOS = g_pGame->GetMOSystem();

		SetTrackedEntity(m_trackedEntity.c_str());
	}
}
开发者ID:amrhead,项目名称:eaascode,代码行数:23,代码来源:HUDMissionObjectiveSystem.cpp


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