本文整理汇总了C++中FitIniFile::readIdUChar方法的典型用法代码示例。如果您正苦于以下问题:C++ FitIniFile::readIdUChar方法的具体用法?C++ FitIniFile::readIdUChar怎么用?C++ FitIniFile::readIdUChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FitIniFile
的用法示例。
在下文中一共展示了FitIniFile::readIdUChar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void LogisticsVehicle::init(FitIniFile& file)
{
componentCount = 0;
file.seekBlock("ObjectType");
char tmp[256];
file.readIdString("AppearanceName", tmp, 255);
fileName = tmp;
file.seekBlock("General");
file.readIdLong("DescIndex", chassisNameID);
file.readIdFloat("CurTonnage", maxWeight);
char tmpWeightClass[256];
cLoadString(IDS_VEHICLE_CLASS, tmpWeightClass, 256);
mechClass = tmpWeightClass;
if(NO_ERROR != file.readIdLong("HouseID", houseID))
{
houseID = -1;
}
if(NO_ERROR != file.readIdLong("EncyclopediaID", encyclopediaID))
{
encyclopediaID = IDS_VEHICLE_DESCRIPTION_0;
}
file.seekBlock("VehicleDynamics");
file.readIdFloat("MaxVelocity", speed);
PSTR parts[5] = { "Front", "Left", "Right", "Rear", "Turret" };
baseArmor = 0;
uint8_t pts;
int32_t i;
for(i = 0; i < 5; i++)
{
file.seekBlock(parts[i]);
file.readIdUChar("MaxArmorPoints", pts);
baseArmor += pts;
file.readIdUChar("CurInternalStructure", pts);
baseArmor += pts;
}
file.seekBlock("InventoryInfo");
file.readIdUChar("NumWeapons", pts);
char blockName[256];
for(i = 4; i < 4 + pts; i++)
{
sprintf(blockName, "Item:%ld", i);
if(NO_ERROR == file.seekBlock(blockName))
{
uint8_t fitID;
file.readIdUChar("MasterID", fitID);
LogisticsComponent* pComponent = LogisticsData::instance->getComponent(fitID);
if(pComponent)
{
components[componentCount].component = pComponent;
components[componentCount].xCoord = 0;
components[componentCount].yCoord = 0;
componentCount++;
}
}
}
}