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


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

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


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

示例1: SerializeTable

void CScriptProxy::SerializeTable( TSerialize ser, const char* name )
{
	CHECK_SCRIPT_STACK;

	SmartScriptTable table;
	if (ser.IsReading())
	{
		if (ser.BeginOptionalGroup(name,true))
		{
			table = SmartScriptTable(m_pThis->GetScriptSystem());
			ser.Value( "table", table );
			m_pThis->SetValue(name, table);
			ser.EndGroup();
		}
	}
	else
	{
		if (m_pThis->GetValue(name, table))
		{
			ser.BeginGroup(name);
			ser.Value( "table", table );
			ser.EndGroup();
		}
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:25,代码来源:ScriptProxy.cpp

示例2: Serialize

void SGrabStats::Serialize(TSerialize ser)
{
	assert(ser.GetSerializationTarget() != eST_Network);

	if(ser.BeginOptionalGroup("SGrabStats", true))
	{
		//when reading, reset the structure first.
		if(ser.IsReading())
			Reset();

		ser.Value("grabId", grabId);
		ser.Value("dropId", dropId);
		ser.Value("lHoldPos", lHoldPos);
		ser.Value("throwVector", throwVector);
		ser.Value("additionalRotation", additionalRotation);

		ser.Value("limbNum", limbNum);

		for(int i=0; i < limbNum; ++i)
		{
			char limbName[64];
			_snprintf(limbName, 64, "limbId%d", i);

			ser.Value(limbName, limbId[i]);
		}

		ser.Value("resetFlagsDelay", resetFlagsDelay);
		ser.Value("grabDelay", grabDelay);
		ser.Value("throwDelay", throwDelay);
		ser.Value("maxDelay", maxDelay);
		ser.Value("followSpeed", followSpeed);
		ser.Value("useIKRotation", useIKRotation);
		ser.Value("collisionFlags", collisionFlags);
		ser.Value("usingAnimation", usingAnimation);
		ser.Value("usingAnimationForGrab", usingAnimationForGrab);
		ser.Value("usingAnimationForDrop", usingAnimationForDrop);
		ser.ValueChar("carryAnimGraphInput", (char *)carryAnimGraphInput, s_maxAGInputNameLen);
		ser.ValueChar("grabAnimGraphSignal", (char *)grabAnimGraphSignal, s_maxAGInputNameLen);
		ser.ValueChar("dropAnimGraphSignal", (char *)dropAnimGraphSignal, s_maxAGInputNameLen);

		ser.Value("IKActive", IKActive);
		ser.Value("releaseIKTime", releaseIKTime);
		ser.Value("followBoneID", followBoneID);
		ser.Value("followBoneWPos", followBoneWPos);
		ser.Value("grabbedObjOfs", grabbedObjOfs);

		ser.Value("readIkInaccuracyCorrection", readIkInaccuracyCorrection);
		ser.Value("ikInaccuracyCorrection", ikInaccuracyCorrection);

		ser.Value("origRotation", origRotation);
		ser.Value("origEndBoneWorldRotTrans", origEndBoneWorldRot.t);
		ser.Value("origEndBoneWorldRotQuat", origEndBoneWorldRot.q);
		ser.Value("origRotationsValid", origRotationsValid);

		ser.Value("entityGrabSpot", entityGrabSpot);
		ser.Value("boneGrabOffset", boneGrabOffset);

		ser.EndGroup();
	}
}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:60,代码来源:GrabHandler.cpp

示例3: SerializeDestination

void CHomingMissile::SerializeDestination( TSerialize ser )
{
	bool gotdestination=!m_destination.IsZero();
	if (ser.BeginOptionalGroup("gotdestination", gotdestination))
	{
		ser.Value("destination", m_destination, 'wrl3');
		ser.EndGroup();
	}
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:9,代码来源:HomingMissile.cpp

示例4: Serialize

void CSPAnalyst::Serialize(TSerialize ser)
{
    if(ser.BeginOptionalGroup("SPAnalyst", true))
    {
        ser.Value("levelStartTime", m_gameAnalysis.levelStartTime);
        ser.Value("gameStartTime", m_gameAnalysis.gameStartTime);
        m_gameAnalysis.player.Serialize(ser);
        ser.EndGroup();
    }
}
开发者ID:pl4,项目名称:CryGame,代码行数:10,代码来源:SPAnalyst.cpp

示例5: Serialize

//------------------------------------------------------------------------------------------------------------------------
void CCustomAction::Serialize( TSerialize ser )
{
	ser.BeginGroup("ActiveAction");
	{
		ser.Value( "m_customActionGraphName", m_customActionGraphName );

		EntityId objectId = m_pObjectEntity && !ser.IsReading() ? m_pObjectEntity->GetId() : 0;
		ser.Value( "objectId", objectId );
		if (ser.IsReading())
			m_pObjectEntity = gEnv->pEntitySystem->GetEntity( objectId );

		if (ser.IsReading())
		{
			int currentState = CAS_Ended;
			ser.Value( "m_currentState", currentState );

			// Due to numerous flownodes not being serialized, don't allow custom actions to be in an intermediate state which
			// will never be set again
			if (currentState != CAS_Succeeded && currentState != CAS_SucceededWait)
			{
				currentState = CAS_Ended;
			}

			m_currentState = (ECustomActionState)currentState;
		}
		else
		{
			int currentState = (int)m_currentState;
			ser.Value( "m_currentState", currentState );
		}

		if (ser.BeginOptionalGroup( "m_pFlowGraph", m_pFlowGraph != NULL))
		{
			if (ser.IsReading())
			{
				ICustomAction* pAction = gEnv->pGame->GetIGameFramework()->GetICustomActionManager()->GetCustomActionFromLibrary( m_customActionGraphName );
				CRY_ASSERT( pAction );
				if (pAction)
					m_pFlowGraph = pAction->GetFlowGraph()->Clone();
				if (m_pFlowGraph)
					m_pFlowGraph->SetCustomAction(this);
			}
			if (m_pFlowGraph)
			{
				m_pFlowGraph->SetGraphEntity( objectId,0 );
				m_pFlowGraph->Serialize( ser );
			}
			ser.EndGroup(); //m_pFlowGraph
		}
	}
	ser.EndGroup();
}
开发者ID:joewan,项目名称:pycmake,代码行数:53,代码来源:CustomAction.cpp

示例6: Serialize

void CBaseGrabHandler::Serialize(TSerialize ser)
{
	assert(ser.GetSerializationTarget() != eST_Network);

	if (ser.BeginOptionalGroup("CBaseGrabHandler", true))
	{
		m_grabStats.Serialize(ser);

		// NOTE Apr 11, 2007: <pvl> for reading, m_pActor has already been taken
		// care of in the constructor.
		
		ser.EndGroup();
	}
}
开发者ID:AiYong,项目名称:CryGame,代码行数:14,代码来源:GrabHandler.cpp

示例7: Serialize

void CTriggerProxy::Serialize( TSerialize ser )
{
	if (ser.GetSerializationTarget() != eST_Network)
	{
		if (ser.BeginOptionalGroup("TriggerProxy",true))
		{
			ser.Value("BoxMin",m_aabb.min);
			ser.Value("BoxMax",m_aabb.max);
			ser.EndGroup();
		}
		
		if (ser.IsReading())
			OnMove();
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:15,代码来源:TriggerProxy.cpp

示例8: Serialize

void CScriptProxy::Serialize( TSerialize ser )
{
	CHECK_SCRIPT_STACK;

	if (ser.GetSerializationTarget() != eST_Network)
	{
		MEMSTAT_CONTEXT(EMemStatContextTypes::MSC_Other, 0, "Script proxy serialization");

		if (NeedSerialize())
		{
			if (ser.BeginOptionalGroup("ScriptProxy", true))
			{
				ser.Value("scriptUpdateRate", m_fScriptUpdateRate);
				int currStateId = m_nCurrStateId;
				ser.Value("currStateId", currStateId);

				// Simulate state change
				if (m_nCurrStateId != currStateId)
				{
					// If state changed kill all old timers.
					m_pEntity->KillTimer(-1);
					m_nCurrStateId = currStateId;
				}
				if (ser.IsReading())
				{
					// Repeat check if update script function is implemented.
					m_bUpdateScript = CurrentState()->IsStateFunctionImplemented(ScriptState_OnUpdate);
				}

				if (CVar::pEnableFullScriptSave && CVar::pEnableFullScriptSave->GetIVal())
				{
					ser.Value( "FullScriptData", m_pThis );
				}
				else if (m_pThis->HaveValue("OnSave") && m_pThis->HaveValue("OnLoad"))
				{
					//SerializeTable( ser, "Properties" );
					//SerializeTable( ser, "PropertiesInstance" );
					//SerializeTable( ser, "Events" );

					SmartScriptTable persistTable(m_pThis->GetScriptSystem());
					if (ser.IsWriting())
						Script::CallMethod(m_pThis, "OnSave", persistTable);
					ser.Value( "ScriptData", persistTable.GetPtr());
					if (ser.IsReading())
						Script::CallMethod(m_pThis, "OnLoad", persistTable);
				}

				ser.EndGroup(); //ScriptProxy
			}
			else
			{
				// If we haven't already serialized the script proxy then reset it back to the default state.

				CRY_ASSERT(m_pScript);

				m_pScript->Call_OnReset(m_pThis, true);
			}
		}
	}
	else
	{
		int stateId = m_nCurrStateId;
		ser.Value("currStateId", stateId, 'sSts');
		if (ser.IsReading())
			GotoState(stateId);
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:67,代码来源:ScriptProxy.cpp


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