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


C++ DataTableRow::getCell方法代码示例

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


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

示例1: loadSchematicGroups

void SchematicMap::loadSchematicGroups() {
	TemplateManager* templateManager = TemplateManager::instance();

	IffStream* iffStream = templateManager->openIffFile(
			"datatables/crafting/schematic_group.iff");

	if (iffStream == NULL) {
		info("schematic_group.iff could not be found.", true);
		return;
	}

	DataTableIff dtiff;
	dtiff.readObject(iffStream);

	String groupId, schematicName;

	for (int i = 0; i < dtiff.getTotalRows(); ++i) {

		DataTableRow* row = dtiff.getRow(i);

		row->getCell(0)->getValue(groupId);
		row->getCell(1)->getValue(schematicName);

		iffGroupMap.put(schematicName.hashCode(), groupId);
	}

	delete iffStream;

	buildSchematicGroups();
}
开发者ID:JigglyPoofSWG,项目名称:BSS,代码行数:30,代码来源:SchematicMap.cpp

示例2: loadTravelFares

void PlanetManagerImplementation::loadTravelFares() {
	TemplateManager* templateManager = TemplateManager::instance();

	IffStream* iffStream = templateManager->openIffFile("datatables/travel/travel.iff");

	if (iffStream == NULL) {
		warning("Travel fares could not be found.");
		return;
	}

	DataTableIff dtiff;
	dtiff.readObject(iffStream);

	delete iffStream;

	//Initialize the rows so we can do a symmetric insert
	for(int i = 0; i < dtiff.getTotalRows(); i++) {
		VectorMap<String, int> planetFares;
		DataTableRow* row =  dtiff.getRow(i);
		String departurePlanet = "";
		row->getCell(0)->getValue(departurePlanet);
		travelFares.put(departurePlanet, planetFares);
	}

	//Insert values
	for(int i = 0; i < dtiff.getTotalRows(); i++) {
		DataTableRow* row =  dtiff.getRow(i);
		String departurePlanet = "";
		row->getCell(0)->getValue(departurePlanet);

		for(int j=i+1; j<dtiff.getTotalColumns(); j++) {
			String arrivalPlanet = dtiff.getColumnNameByIndex(j);
			int fare = 0;
			row->getCell(j)->getValue(fare);
			travelFares.get(departurePlanet).put(arrivalPlanet, fare);
			if(arrivalPlanet != departurePlanet)
				travelFares.get(arrivalPlanet).put(departurePlanet, fare);
		}
	}

	info("Loaded travel fares to " + String::valueOf(travelFares.size()) + " planets.");
}
开发者ID:Mesagoppinmypants,项目名称:mtgtestserver,代码行数:42,代码来源:PlanetManagerImplementation.cpp

示例3:

Vector<DataTableRow*> DataTableIff::getRowsByColumn(int columnIdx, const String& columnValue) {
	Vector<DataTableRow*> retRows;

	for (int i = 0; i < rows.size(); ++i) {
		DataTableRow* row = rows.get(i);

		if (row->getCell(columnIdx)->toString() == columnValue)
			retRows.add(row);
	}

	return retRows;
}
开发者ID:Marott1,项目名称:Core3,代码行数:12,代码来源:DataTableIff.cpp

示例4: loadCustomizationData

void ImageDesignManager::loadCustomizationData() {
	TemplateManager* templateManager = TemplateManager::instance();

	IffStream* iffStream = templateManager->openIffFile("datatables/customization/customization_data.iff");

	if (iffStream == NULL)
		return;

	//Get the datatable, and parse it into a datatable object.
	DataTableIff dataTable;
	dataTable.readObject(iffStream);

	for (int i = 0; i < dataTable.getTotalRows(); i++) {
		DataTableRow* dataRow = dataTable.getRow(i);

		if (dataRow == NULL)
			continue;

		//Get the species gender
		String speciesGender = dataRow->getCell(0)->toString();
		uint32 templateCRC = String::hashCode("object/creature/player/" + speciesGender + ".iff");
		PlayerCreatureTemplate* tmpl = dynamic_cast<PlayerCreatureTemplate*>(templateManager->getTemplate(templateCRC));

		if (tmpl == NULL)
			continue;

		CustomizationDataMap* dataMap = tmpl->getCustomizationDataMap();

		if (dataMap == NULL)
			continue;

		CustomizationData customizationData;
		customizationData.parseRow(dataRow);

		customizationData.setMinScale(tmpl->getMinScale());
		customizationData.setMaxScale(tmpl->getMaxScale());

		dataMap->put(customizationData.getCustomizationName(), customizationData);

	}

	//Done with the stream, so delete it.
	if (iffStream != NULL) {
		delete iffStream;
		iffStream = NULL;
	}

}
开发者ID:Marott1,项目名称:Core3,代码行数:48,代码来源:ImageDesignManager.cpp

示例5: loadSocialTypes

void ChatManagerImplementation::loadSocialTypes() {
	IffStream* iffStream = TemplateManager::instance()->openIffFile("datatables/chat/social_types.iff");

	if (iffStream == NULL) {
		error("Could not load social types.");
		return;
	}

	DataTableIff dtiff;
	dtiff.readObject(iffStream);

	delete iffStream;

	for (int i = 0; i < dtiff.getTotalRows(); ++i) {
		DataTableRow* row = dtiff.getRow(i);

		String key;
		row->getCell(0)->getValue(key);
		socialTypes.put(i + 1, key);
	}

	info("Loaded " + String::valueOf(socialTypes.size()) + " social types.", true);
}
开发者ID:Mesagoppinmypants,项目名称:mtgserver,代码行数:23,代码来源:ChatManagerImplementation.cpp

示例6: buildTreeFromClient

bool ResourceTree::buildTreeFromClient() {
	TemplateManager* templateManager = TemplateManager::instance();

	IffStream* iffStream = templateManager->openIffFile("datatables/resource/resource_tree.iff");

	if (iffStream == NULL) {
		info("The Resource Tree could not be found.", true);
		return false;
	}

	DataTableIff dtiff;
	dtiff.readObject(iffStream);

	Vector<String> currentClasses;
	Vector<String> currentStfClasses;

	baseNode = new ResourceTreeNode("resource", "Resources", 0);

	String stringvalue, randomname, resourcecontainer;
	int intvalue;
	bool boolValue;

	for (int i = 1; i < dtiff.getTotalRows(); ++i) {

		DataTableRow* row = dtiff.getRow(i);

		row->getValue(1, stringvalue);

		ResourceTreeEntry* entry = new ResourceTreeEntry(stringvalue);

		for (int j = 3; j <= 9; ++j) {
			String resourceclass;
			row->getValue(j, resourceclass);

			if (resourceclass.isEmpty())
				continue;

			while (currentStfClasses.size() > j - 3) {
				currentStfClasses.removeElementAt(j - 3);
				currentClasses.removeElementAt(j - 3);
			}

			currentStfClasses.add(stringvalue);
			currentClasses.add(resourceclass);
		}

		for (int j = 0; j < currentStfClasses.size(); ++j) {
			entry->addClass(currentClasses.get(j));
			entry->addStfClass(currentStfClasses.get(j));
		}

		row->getValue(10, intvalue);
		entry->setMaxtype(intvalue);

		row->getValue(11, intvalue);
		entry->setMintype(intvalue);

		row->getValue(12, intvalue);
		entry->setMinpool(intvalue);

		row->getValue(13, intvalue);
		entry->setMaxpool(intvalue);

		row->getValue(14, boolValue);
		entry->setRecycled(boolValue);

		for (int j = 16; j <= 26; ++j) {
			row->getValue(j, stringvalue);
			if (stringvalue == "")
				break;

			int min;
			row->getCell(j + 11 + (j - 16))->getValue(min);

			int max;
			row->getCell(j + 12 + (j - 16))->getValue(max);

			entry->addAttribute(new ResourceAttribute(stringvalue, min, max));
		}

		row->getCell(49)->getValue(stringvalue);
		if(stringvalue != "")
			resourcecontainer = stringvalue;
		entry->setResourceContainerType(resourcecontainer);

		row->getCell(50)->getValue(stringvalue);
		if(stringvalue != "")
				randomname = stringvalue;
		entry->setRandomNameClass(randomname);

		setZoneRestriction(entry);
		setJtl(entry);
		setSurveyToolType(entry);
		setRecycleToolType(entry);

		/// Add entry to the tree
		baseNode->add(entry);
	}
	/// Update the Stf Entries now that the tree is built
	//baseNode->updateEntries();
//.........这里部分代码省略.........
开发者ID:Chilastra-Reborn,项目名称:Core3,代码行数:101,代码来源:ResourceTree.cpp


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