本文整理汇总了C++中database::Results::GetFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ Results::GetFloat方法的具体用法?C++ Results::GetFloat怎么用?C++ Results::GetFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database::Results
的用法示例。
在下文中一共展示了Results::GetFloat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CacheResults
//.........这里部分代码省略.........
Database::Results* pResults = kUtility.GetResults(strKey);
if(pResults == NULL)
{
pResults = kUtility.PrepareResults(strKey, "select Technologies.ID from Unit_TechTypes inner join Technologies on TechType = Technologies.Type where UnitType = ?");
}
pResults->Bind(1, szUnitType, -1, false);
int i = 0;
while(pResults->Step())
{
m_piPrereqAndTechs[i++] = pResults->GetInt(0);
}
pResults->Reset();
}
//Unit Unique Names Count
{
std::string strKey = "Units - UniqueNameCount";
Database::Results* pUnitNameCount = kUtility.GetResults(strKey);
if(pUnitNameCount == NULL)
{
pUnitNameCount = kUtility.PrepareResults(strKey, "select count(*) from Unit_UniqueNames where UnitType = ?");
}
pUnitNameCount->Bind(1, szUnitType, -1, false);
pUnitNameCount->Step();
m_iNumUnitNames = pUnitNameCount->GetInt(0);
pUnitNameCount->Reset();
}
//Unit Unique Names
{
if(m_iNumUnitNames > 0)
{
m_paszUnitNames = FNEW(CvString[m_iNumUnitNames], c_eCiv5GameplayDLL, 0);
std::string strKey = "Units - UniqueNames";
Database::Results* pResults = kUtility.GetResults(strKey);
if(pResults == NULL)
{
pResults = kUtility.PrepareResults(strKey, "select UniqueName from Unit_UniqueNames where UnitType = ?");
}
pResults->Bind(1, szUnitType, -1, false);
int i = 0;
while(pResults->Step())
{
m_paszUnitNames[i++] = pResults->GetText(0);
}
pResults->Reset();
}
}
//MovementRates
{
std::string strKey = "Units - MovementRates";
Database::Results* pMovementRates = kUtility.GetResults(strKey);
if(pMovementRates == NULL)
{
pMovementRates = kUtility.PrepareResults(strKey, "SELECT * FROM MovementRates where Type = ? ORDER BY NumHexes");
}
const char* szMovementRate = kResults.GetText("MoveRate");
pMovementRates->Bind(1, szMovementRate, -1, false);
while(pMovementRates->Step())
{
int f0 = pMovementRates->GetInt("NumHexes") - 1;
float f1 = pMovementRates->GetFloat("TotalTime");
float f2 = pMovementRates->GetFloat("EaseIn");
float f3 = pMovementRates->GetFloat("EaseOut");
float f4 = pMovementRates->GetFloat("IndividualOffset");
float f5 = pMovementRates->GetFloat("RowOffset");
float f6 = pMovementRates->GetFloat("CurveRoll");
int iPathSubdivision = pMovementRates->GetInt("PathSubdivision");
if(f0 >= 0 && f0 <= 11)
{
m_unitMoveRate[f0].m_fTotalMoveRate = f1;
m_unitMoveRate[f0].m_fEaseIn = f2;
m_unitMoveRate[f0].m_fEaseOut = f3;
m_unitMoveRate[f0].m_fIndividualOffset = f4;
m_unitMoveRate[f0].m_fRowOffset = f5;
m_unitMoveRate[f0].m_fCurveRoll = f6;
m_unitMoveRate[f0].m_iPathSubdivision = iPathSubdivision;
}
}
pMovementRates->Reset();
}
// Calculate military Power and cache it
DoUpdatePower();
return true;
}