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


C++ CDataReader::getLineTokens方法代码示例

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


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

示例1:

void			CIPLEntry_PATH_Node::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	if (getLatestPathGroup() == nullptr)
	{
		// path node found before path group
		throw EXCEPTION_INVALID_DATA_ORDER;
	}

	switch (pDataReader->getLineTokens().size())
	{
	case 12:
		CIPLEntry_PATH::unserialize();

		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_VC);

		m_uiNodeType = pDataReader->readTokenUint32();
		m_uiNextNode = pDataReader->readTokenUint32();
		m_uiIsCrossRoad = pDataReader->readTokenUint32();
		m_vecPosition = pDataReader->readTokenVector3D() / 16.0f;
		m_fMedian = pDataReader->readTokenFloat32();
		m_uiLeftLaneCount = pDataReader->readTokenUint32();
		m_uiRightLaneCount = pDataReader->readTokenUint32();
		m_uiSpeedLimit = pDataReader->readTokenUint32();
		m_uiFlags = pDataReader->readTokenUint32();
		m_fSpawnRate = pDataReader->readTokenFloat32();
		break;
	}

	getLatestPathGroup()->addEntry(this);
}
开发者ID:X-Seti,项目名称:KGM,代码行数:33,代码来源:CIPLEntry_PATH_Node.cpp

示例2:

void			CIPLEntry_PICK::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	switch (pDataReader->getLineTokens().size())
	{
	case 4:
		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_SA);

		m_uiWeaponId = pDataReader->readTokenUint32();
		m_vecPosition = pDataReader->readTokenVector3D();
		break;
	default:
		throw EXCEPTION_UNKNOWN_FORMAT_TYPE;
	}
}
开发者ID:X-Seti,项目名称:KGM,代码行数:17,代码来源:CIPLEntry_PICK.cpp

示例3:

void			CIDEEntry_HIER::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	switch (pDataReader->getLineTokens().size())
	{
	case 3:
		// GTA III, GTA VC, GTA SA
		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_III | GAME_FLAG_GTA_VC | GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		break;
	default:
		throw EXCEPTION_UNKNOWN_FORMAT_TYPE;
	}
}
开发者ID:X-Seti,项目名称:KGM,代码行数:18,代码来源:CIDEEntry_HIER.cpp

示例4:

void			CIDEEntry_PATH_Group::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	switch (pDataReader->getLineTokens().size())
	{
	case 3:
		CIDEEntry_PATH::unserialize();

		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_III | GAME_FLAG_GTA_VC);

		m_strGroupType = pDataReader->readTokenString();
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenUint32();
		break;
	}

	setLatestPathGroup(this);
}
开发者ID:X-Seti,项目名称:KGM,代码行数:20,代码来源:CIDEEntry_PATH_Group.cpp

示例5: switch

void			CIPLEntry_JUMP::unserialize(void)
{
    CDataReader *pDataReader = CDataReader::getInstance();

    switch (pDataReader->getLineTokens().size())
    {
    case 16:
        setFormatType(0);
        setFormatGames(GAME_FLAG_GTA_SA);

        m_vecStartLowerPosition = pDataReader->readTokenVector3D();
        m_vecStartUpperPosition = pDataReader->readTokenVector3D();
        m_vecTargetLowerPosition = pDataReader->readTokenVector3D();
        m_vecTargetUpperPosition = pDataReader->readTokenVector3D();
        m_vecCameraPosition = pDataReader->readTokenVector3D();
        m_uiReward = pDataReader->readTokenUint32();
        break;
    default:
        throw EXCEPTION_UNKNOWN_FORMAT_TYPE;
    }
}
开发者ID:X-Seti,项目名称:KGM,代码行数:21,代码来源:CIPLEntry_JUMP.cpp

示例6:

void			CIPLEntry_TCYC::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	switch (pDataReader->getLineTokens().size())
	{
	case 11:
		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_SA);

		m_vecPositionLower = pDataReader->readTokenVector3D();
		m_vecPositionUpper = pDataReader->readTokenVector3D();
		m_uiUnknown1 = pDataReader->readTokenUint32();
		m_uiWeatherId = pDataReader->readTokenUint32();
		m_iBrightness = pDataReader->readTokenInt32();
		m_uiTime = pDataReader->readTokenUint32();
		m_uiDrawDistance = pDataReader->readTokenUint32();
		break;
	default:
		throw EXCEPTION_UNKNOWN_FORMAT_TYPE;
	}
}
开发者ID:X-Seti,项目名称:KGM,代码行数:22,代码来源:CIPLEntry_TCYC.cpp

示例7:

void			CIDEEntry_ANIM::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	switch (pDataReader->getLineTokens().size())
	{
	case 6:
		// GTA SA
		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_strAnimationName = pDataReader->readTokenString();
		m_fDrawDistance = pDataReader->readTokenFloat32();
		m_uiFlags = pDataReader->readTokenUint32();
		break;
	case 16:
		// GTA IV
		setFormatType(1);
		setFormatGames(GAME_FLAG_GTA_IV);
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_strAnimationName = pDataReader->readTokenString();
		m_fDrawDistance = pDataReader->readTokenFloat32();
		m_uiFlags = pDataReader->readTokenUint32();
		m_uiUnknown1 = pDataReader->readTokenUint32();
		m_vecBoundingBoxLowerLeftCorner = pDataReader->readVector3D();
		m_vecBoundingBoxUpperRightCorner = pDataReader->readVector3D();
		m_vecBoundingSphereCenterPosition = pDataReader->readVector3D();
		m_fBoundingSphereRadius = pDataReader->readTokenFloat32();
		m_strLODModel = pDataReader->readTokenString();
		break;
	default:
		throw EXCEPTION_UNKNOWN_FORMAT_TYPE;
	}
}
开发者ID:X-Seti,项目名称:KGM,代码行数:37,代码来源:CIDEEntry_ANIM.cpp

示例8:

void			CIDEEntry_TOBJ::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	switch (pDataReader->getLineTokens().size())
	{
	case 4: // Type 0: GTA III, VC, SA
		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_III | GAME_FLAG_GTA_VC | GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_uiUnknown2 = pDataReader->readTokenUint32();
		break;
	case 8: // Type 1: GTA III, VC, SA
		setFormatType(1);
		setFormatGames(GAME_FLAG_GTA_III | GAME_FLAG_GTA_VC | GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_uiClumpCount = pDataReader->readTokenUint32();
		m_vecDrawDistances = {
			pDataReader->readTokenFloat32()
		};
		m_uiFlags = pDataReader->readTokenUint32();
		m_uiTimeOn = pDataReader->readTokenUint32();
		m_uiTimeOff = pDataReader->readTokenUint32();
		break;
	case 9: // Type 2: GTA III, VC, SA
		setFormatType(2);
		setFormatGames(GAME_FLAG_GTA_III | GAME_FLAG_GTA_VC | GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_uiClumpCount = pDataReader->readTokenUint32();
		m_vecDrawDistances = {
			pDataReader->readTokenFloat32(),
			pDataReader->readTokenFloat32()
		};
		m_uiFlags = pDataReader->readTokenUint32();
		m_uiTimeOn = pDataReader->readTokenUint32();
		m_uiTimeOff = pDataReader->readTokenUint32();
		break;
	case 10: // Type 3: GTA III, VC, SA
		setFormatType(3);
		setFormatGames(GAME_FLAG_GTA_III | GAME_FLAG_GTA_VC | GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_uiClumpCount = pDataReader->readTokenUint32();
		m_vecDrawDistances = {
			pDataReader->readTokenFloat32(),
			pDataReader->readTokenFloat32(),
			pDataReader->readTokenFloat32()
		};
		m_uiFlags = pDataReader->readTokenUint32();
		m_uiTimeOn = pDataReader->readTokenUint32();
		m_uiTimeOff = pDataReader->readTokenUint32();
		break;
	case 7: // Type 4: GTA SA
		setFormatType(4);
		setFormatGames(GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_vecDrawDistances = {
			pDataReader->readTokenFloat32()
		};
		m_uiFlags = pDataReader->readTokenUint32();
		m_uiTimeOn = pDataReader->readTokenUint32();
		m_uiTimeOff = pDataReader->readTokenUint32();
		break;
	case 17:
		// TOBJ - type 5: GTA IV [type 1 for GTA IV]
		setFormatType(5);
		setFormatGames(GAME_FLAG_GTA_IV);
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_vecDrawDistances.push_back(pDataReader->readTokenFloat32());
		m_uiFlags = pDataReader->readTokenUint32();
		m_uiUnknown2 = pDataReader->readTokenUint32();
		m_vecBoundingBoxLowerLeftCorner = pDataReader->readVector3D();
		m_vecBoundingBoxUpperRightCorner = pDataReader->readVector3D();
		m_vecBoundingSphereCenterPosition = pDataReader->readVector3D();
		m_fBoundingSphereRadius = pDataReader->readTokenFloat32();
		m_strLODModel = pDataReader->readTokenString();
		m_uiNightFlags = pDataReader->readTokenUint32();
		break;
	default:
	{
		uint32 uiLineTokenCount = pDataReader->getLineTokenCount();
		uint32 uiTokenIndex = 4; // starting at 1, so it can be compared directly with line token count

		setFormatType(6);
		setTokenCount(uiLineTokenCount);

		// first 4 tokens
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
//.........这里部分代码省略.........
开发者ID:X-Seti,项目名称:KGM,代码行数:101,代码来源:CIDEEntry_TOBJ.cpp

示例9:

void			CIDEEntry_PEDS::unserialize(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();

	uint32 uiLineTokenCount = pDataReader->getLineTokens().size();
	bool bMatchFound = false;
	if (uiLineTokenCount == 7 || uiLineTokenCount == 11 || uiLineTokenCount == 15)
	{
		// GTA III, GTA VC, GTA SA
		bMatchFound = true;
		setFormatType(0);
		setFormatGames(GAME_FLAG_GTA_III | GAME_FLAG_GTA_VC | GAME_FLAG_GTA_SA);
		m_uiObjectId = pDataReader->readTokenUint32();
		m_strModelName = pDataReader->readTokenString();
		m_strTXDName = pDataReader->readTokenString();
		m_strDefaultPedType = pDataReader->readTokenString();
		m_strBehaviour = pDataReader->readTokenString();
		m_strAnimationGroup = pDataReader->readTokenString();
		m_uiCarsCanDrive = pDataReader->readTokenUint32();

		if (uiLineTokenCount == 11 || uiLineTokenCount == 15)
		{
			// GTA VC, GTA SA
			setFormatType(1);
			setFormatGames(GAME_FLAG_GTA_VC | GAME_FLAG_GTA_SA);
			m_strAnimationFile = pDataReader->readTokenString();
			m_vecPreferredRadioStations.m_x = pDataReader->readTokenUint32();
			m_vecPreferredRadioStations.m_y = pDataReader->readTokenUint32();

			if (uiLineTokenCount == 15)
			{
				// GTA SA
				setFormatType(2);
				setFormatGames(GAME_FLAG_GTA_SA);
				m_strVoiceArchive = pDataReader->readTokenString();
				m_strVoices[0] = pDataReader->readTokenString();
				m_strVoices[1] = pDataReader->readTokenString();
			}
		}
	}

	if (uiLineTokenCount == 16)
	{
		// GTA IV
		bMatchFound = true;
		setFormatType(3);
		setFormatGames(GAME_FLAG_GTA_IV);
		m_strModelName = pDataReader->readTokenString();
		m_strProps = pDataReader->readTokenString();
		m_strDefaultPedType = pDataReader->readTokenString();
		m_strAnimationGroup = pDataReader->readTokenString();
		m_strGestureGroup = pDataReader->readTokenString();
		m_strGesturePhoneGroup = pDataReader->readTokenString();
		m_strFacialGroup = pDataReader->readTokenString();
		m_strVisemeGroup = pDataReader->readTokenString();
		m_strFlags = pDataReader->readTokenString();
		m_strAnimationFile = pDataReader->readTokenString();
		m_strBlendShapeFile = pDataReader->readTokenString();
		m_vecPreferredRadioStations.m_x = pDataReader->readTokenUint32();
		m_vecPreferredRadioStations.m_y = pDataReader->readTokenUint32();
		m_strAudioType = pDataReader->readTokenString();
		m_strFirstVoice = pDataReader->readTokenString();
		m_strLastVoice = pDataReader->readTokenString();
	}

	if (!bMatchFound)
	{
		throw EXCEPTION_UNKNOWN_FORMAT_TYPE;
	}
}
开发者ID:X-Seti,项目名称:KGM,代码行数:70,代码来源:CIDEEntry_PEDS.cpp


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