本文整理汇总了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();
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
}
示例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());
}
}