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


C++ DataTable::getFloatValue方法代码示例

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


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

示例1: changeTeleportDestination

void BuildingObject::changeTeleportDestination(Vector & position, float & yaw) const
{
	if (!isAuthoritative())
	{
		WARNING(true, ("BuildingObject::changeTeleportDestination called on "
			"non-authoritative building %s", getNetworkId().getValueString().c_str()));
		return;
	}

	// call a script trigger that will give us the index of the cloning facility
	// tube to respawn in, if any
	int index = -1;
	ScriptParams params;
	params.addParam(index);
	IGNORE_RETURN(const_cast<GameScriptObject *>(getScriptObject())->trigAllScripts(
		Scripting::TRIG_GET_RESPAWN_LOC, params));
	index = params.getIntParam(0);
	if (index >= 0)
	{
		DataTable * respawnTable = DataTableManager::getTable(CLONE_RESPAWN_TABLE, 
			true);
		if (respawnTable != NULL)
		{
			int row = respawnTable->searchColumnString(0, getTemplateName());
			if (row >= 0)
			{
				char buffer[32];
				sprintf(buffer, "TUBE%d_X", index+1);
				int column = respawnTable->findColumnNumber(buffer);
				if (column >= 0)
				{
					position.x = respawnTable->getFloatValue(column, row);
					position.z = respawnTable->getFloatValue(column+1, row);
					yaw = convertDegreesToRadians(respawnTable->getFloatValue(column+2, row));
				}
			}
		}
	}
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:39,代码来源:BuildingObject.cpp

示例2: getWeaponReloadTimeSeconds

float CombatTimingTable::getWeaponReloadTimeSeconds(std::string const & weaponType)
{
	float result = 0;

	DataTable * combatTimingTable = DataTableManager::getTable(cs_combatTimingTableName, true);
	if (combatTimingTable)
	{
		int rowNum = combatTimingTable->searchColumnString(0, weaponType);
		result = combatTimingTable->getFloatValue("WeaponReloadTimeSeconds", rowNum);
	}

	return result;
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:13,代码来源:CombatTimingTable.cpp

示例3: install

void ShipTurretManager::install() // static
{
    InstallTimer const installTimer("ShipTurretManager::install");

    Iff iff;
    if (iff.open("datatables/space/ship_turret.iff", true))
    {
        DataTable dataTable;
        dataTable.load(iff);
        int numberOfRows = dataTable.getNumRows();
        for (int row = 0; row < numberOfRows; ++row)
        {
            std::string const chassisName(dataTable.getStringValue("chassis", row));
            ShipChassis const * const chassis = ShipChassis::findShipChassisByName(TemporaryCrcString(chassisName.c_str(), false));
            FATAL(!chassis, ("ShipTurretManager::install: no such chassis '%s'", chassisName.c_str()));
            int const weaponIndex = dataTable.getIntValue("weaponIndex", row);
            ShipTurretData &shipTurretData = s_shipTurretData[chassis->getCrc()][weaponIndex];
            shipTurretData.minYaw = dataTable.getFloatValue("minYaw", row) * PI_OVER_180;
            shipTurretData.maxYaw = dataTable.getFloatValue("maxYaw", row) * PI_OVER_180;
            shipTurretData.minPitch = dataTable.getFloatValue("minPitch", row) * PI_OVER_180;
            shipTurretData.maxPitch = dataTable.getFloatValue("maxPitch", row) * PI_OVER_180;
        }
    }
}
开发者ID:grserver,项目名称:infinity,代码行数:24,代码来源:ShipTurretManager.cpp


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