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


C++ FArchive::IsStoring方法代码示例

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


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

示例1: SerializeAll

void DThinker::SerializeAll (FArchive &arc, bool hubLoad, bool noStorePlayers)
{
	DThinker *thinker;
	if (arc.IsStoring () && noStorePlayers)
	{
		thinker = FirstThinker;
		while (thinker)
		{
			// Don't store player mobjs.
			if (!(thinker->IsKindOf(RUNTIME_CLASS(AActor)) &&
			    static_cast<AActor *>(thinker)->type == MT_PLAYER))
			{
				arc << (BYTE)1;
				arc << thinker;
			}
			thinker = thinker->m_Next;
		}
		arc << (BYTE)0;
	}
	else if (arc.IsStoring ())
	{
		thinker = FirstThinker;
		while (thinker)
		{
			arc << (BYTE)1;
			arc << thinker;
			thinker = thinker->m_Next;
		}
		arc << (BYTE)0;
	}
	else
	{
		if (hubLoad || noStorePlayers)
			DestroyMostThinkers ();
		else
			DestroyAllThinkers ();

		BYTE more;
		arc >> more;
		while (more)
		{
			DThinker *thinker;
			arc >> thinker;
			arc >> more;
		}

		// killough 3/26/98: Spawn icon landings:
		P_SpawnBrainTargets ();
	}
}
开发者ID:WChrisK,项目名称:OdaStats,代码行数:50,代码来源:dthinker.cpp

示例2: P_SerializePlayers

//
// P_ArchivePlayers
//
void P_SerializePlayers (FArchive &arc)
{
	size_t i;

	if (arc.IsStoring ())
	{
		for (i = 0; i < players.size(); i++)
			arc << (int)players[i].playerstate;
	}
	else
	{
		int playerstate = (playerstate_t)0;
		for (i = 0; i < players.size(); i++)
		{
		    arc >> playerstate;
            players[i].playerstate = (playerstate_t)playerstate;
		}
	}

	for (i = 0; i < players.size(); i++)
    {
		if (players[i].ingame())
			players[i].Serialize (arc);
    }
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:28,代码来源:p_saveg.cpp

示例3: Serialize

void DPlat::Serialize (FArchive &arc)
{
	Super::Serialize (arc);
	if (arc.IsStoring ())
	{
		arc << m_Speed
			<< m_Low
			<< m_High
			<< m_Wait
			<< m_Count
			<< m_Status
			<< m_OldStatus
			<< m_Crush
			<< m_Tag
			<< m_Type;
	}
	else
	{
		arc >> m_Speed
			>> m_Low
			>> m_High
			>> m_Wait
			>> m_Count
			>> m_Status
			>> m_OldStatus
			>> m_Crush
			>> m_Tag
			>> m_Type;
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:30,代码来源:p_plats.cpp

示例4: SerializeAll

void DThinker::SerializeAll (FArchive &arc, bool hubLoad)
{
	DThinker *thinker;

	if (arc.IsStoring ())
	{
		thinker = FirstThinker;
		while (thinker)
		{
			arc << (BYTE)1;
			arc << thinker;
			thinker = thinker->m_Next;
		}
		arc << (BYTE)0;
	}
	else
	{
		if (hubLoad)
			DestroyMostThinkers ();
		else
			DestroyAllThinkers ();

		BYTE more;
		arc >> more;
		while (more)
		{
			DThinker *thinker;
			arc >> thinker;
			arc >> more;
		}

		// killough 3/26/98: Spawn icon landings:
		P_SpawnBrainTargets ();
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:35,代码来源:dthinker.cpp

示例5: Serialize

void DGlow::Serialize (FArchive &arc)
{
	Super::Serialize (arc);
	if (arc.IsStoring ())
		arc << m_Direction << m_MaxLight << m_MinLight;
	else
		arc >> m_Direction >> m_MaxLight >> m_MinLight;
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:8,代码来源:p_lights.cpp

示例6:

void DGlow2::Serialize (FArchive &arc)
{
	Super::Serialize (arc);
	if (arc.IsStoring ())
		arc << m_End << m_MaxTics << m_OneShot << m_Start << m_Tics;
	else
		arc >> m_End >> m_MaxTics >> m_OneShot >> m_Start >> m_Tics;
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:8,代码来源:p_lights.cpp

示例7: Serialize

void DSectorEffect::Serialize (FArchive &arc)
{
	Super::Serialize (arc);
	if (arc.IsStoring ())
		arc << m_Sector;
	else
		arc >> m_Sector;

}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:9,代码来源:dsectoreffect.cpp

示例8: Serialize

void MapThing::Serialize (FArchive &arc)
{
	if (arc.IsStoring ())
	{
		arc << thingid << x << y << z << angle << type << flags;
	}
	else
	{
		arc >> thingid >> x >> y >> z >> angle >> type >> flags;
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:11,代码来源:p_mobj.cpp

示例9: P_SerializeRNGState

void P_SerializeRNGState (FArchive &arc)
{
	if (arc.IsStoring ())
	{
		arc << prndindex;
	}
	else
	{
		arc >> prndindex;
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:11,代码来源:m_random.cpp

示例10: Serialize

	void Serialize(FArchive & arc)
	{
		arc << xpos << ypos << draw;
		if (arc.IsStoring())
		{
			TexMan.WriteTexture(arc, texturenum);
		}
		else
		{
			texturenum = TexMan.ReadTexture(arc);
		}
	}
开发者ID:ddraigcymraeg,项目名称:gzscoredoom,代码行数:12,代码来源:t_fspic.cpp

示例11: Serialize

void MapThing::Serialize (FArchive &arc)
{
	if (arc.IsStoring ())
	{
		arc << thingid << x << y << z << angle << type << flags << special
			<< args[0] << args[1] << args[2] << args[3] << args[4];
	}
	else
	{
		arc >> thingid >> x >> y >> z >> angle >> type >> flags >> special
			>> args[0] >> args[1] >> args[2] >> args[3] >> args[4];
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:13,代码来源:p_mobj.cpp

示例12: P_SerializePlayers

//
// P_ArchivePlayers
//
void P_SerializePlayers (FArchive &arc, bool skipload)
{
	BYTE numPlayers, numPlayersNow;
	int i;

	// Count the number of players present right now.
	for (numPlayersNow = 0, i = 0; i < MAXPLAYERS; ++i)
	{
		if (playeringame[i])
		{
			++numPlayersNow;
		}
	}

	if (arc.IsStoring())
	{
		// Record the number of players in this save.
		arc << numPlayersNow;

		// Record each player's name, followed by their data.
		for (i = 0; i < MAXPLAYERS; ++i)
		{
			if (playeringame[i])
			{
				arc.WriteString (players[i].userinfo.GetName());
				players[i].Serialize (arc);
			}
		}
	}
	else
	{
		arc << numPlayers;

		// If there is only one player in the game, they go to the
		// first player present, no matter what their name.
		if (numPlayers == 1)
		{
			ReadOnePlayer (arc, skipload);
		}
		else
		{
			ReadMultiplePlayers (arc, numPlayers, numPlayersNow, skipload);
		}
		if (!skipload && numPlayersNow > numPlayers)
		{
			SpawnExtraPlayers ();
		}
		// Redo pitch limits, since the spawned player has them at 0.
		players[consoleplayer].SendPitchLimits();
	}
}
开发者ID:1Akula1,项目名称:gzdoom,代码行数:54,代码来源:p_saveg.cpp

示例13: Serialize

void AScriptedMarine::Serialize (FArchive &arc)
{
	Super::Serialize (arc);

	if (arc.IsStoring ())
	{
		arc.WriteSprite (SpriteOverride);
	}
	else
	{
		SpriteOverride = arc.ReadSprite ();
	}
	arc << CurrentWeapon;
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例14: G_SerializeHub

static void G_SerializeHub(FArchive & arc)
{
	int i=hubdata.Size();
	arc << i;
	if (i>0)
	{
		if (arc.IsStoring()) arc.Write(&hubdata[0], i * sizeof(wbstartstruct_t));
		else 
		{
			hubdata.Resize(i);
			arc.Read(&hubdata[0], i * sizeof(wbstartstruct_t));
		}
	}
	else hubdata.Clear();
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:15,代码来源:g_hub.cpp

示例15: P_SerializePolyobjs

void P_SerializePolyobjs (FArchive &arc)
{
	int i;
	FPolyObj *po;

	if (arc.IsStoring ())
	{
		int seg = ASEG_POLYOBJS;
		arc << seg << po_NumPolyobjs;
		for(i = 0, po = polyobjs; i < po_NumPolyobjs; i++, po++)
		{
			arc << po->tag << po->angle << po->StartSpot.x <<
				po->StartSpot.y << po->interpolation;
  		}
	}
	else
	{
		int data;
		angle_t angle;
		fixed_t deltaX, deltaY;

		arc << data;
		if (data != ASEG_POLYOBJS)
			I_Error ("Polyobject marker missing");

		arc << data;
		if (data != po_NumPolyobjs)
		{
			I_Error ("UnarchivePolyobjs: Bad polyobj count");
		}
		for (i = 0, po = polyobjs; i < po_NumPolyobjs; i++, po++)
		{
			arc << data;
			if (data != po->tag)
			{
				I_Error ("UnarchivePolyobjs: Invalid polyobj tag");
			}
			arc << angle;
			po->RotatePolyobj (angle);
			arc << deltaX << deltaY << po->interpolation;
			deltaX -= po->StartSpot.x;
			deltaY -= po->StartSpot.y;
			po->MovePolyobj (deltaX, deltaY, true);
		}
	}
}
开发者ID:1Akula1,项目名称:gzdoom,代码行数:46,代码来源:p_saveg.cpp


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