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


C++ GFF3Struct::getString方法代码示例

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


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

示例1: loadProperties

void Creature::loadProperties(const Aurora::GFF3Struct &gff) {
	// Tag
	_tag = gff.getString("Tag", _tag);

	// Name

	Aurora::LocString firstName;
	gff.getLocString("FirstName", firstName);
	Aurora::LocString lastName;
	gff.getLocString("LastName", lastName);

	if (!firstName.empty()) {
		_name = firstName.getString();
		if (!lastName.empty())
			_name += " " + lastName.getString();
	}


	// Description
	_description = gff.getString("Description", _description);

	// Portrait
	loadPortrait(gff);

	// Equipment
	loadEquipment(gff);

	// Appearance
	_appearance = gff.getUint("Appearance_Type", _appearance);

	// Static
	_static = gff.getBool("Static", _static);

	// Usable
	_usable = gff.getBool("Useable", _usable);

	// PC
	_isPC = gff.getBool("IsPC", _isPC);

	// Gender
	_gender = Gender(gff.getUint("Gender"));

	// Race
	_race = Race(gff.getSint("Race", _race));
	_subRace = SubRace(gff.getSint("SubraceIndex", _subRace));

	// Hit Points
	_currentHitPoints = gff.getSint("CurrentHitPoints", _maxHitPoints);
	_maxHitPoints = gff.getSint("MaxHitPoints", _currentHitPoints);

	_minOneHitPoint = gff.getBool("Min1HP", _minOneHitPoint);

	// Faction
	_faction = Faction(gff.getUint("FactionID"));

	// Scripts
	readScripts(gff);

	_conversation = gff.getString("Conversation", _conversation);
}
开发者ID:mirv-sillyfish,项目名称:xoreos,代码行数:60,代码来源:creature.cpp

示例2: loadProperties

void Situated::loadProperties(const Aurora::GFF3Struct &gff) {
	// Tag
	_tag = gff.getString("Tag", _tag);

	// Name
	_name = gff.getString("Name", _name);

	// Description
	_description = gff.getString("Description", _description);

	// Portrait
	loadPortrait(gff);

	// Appearance
	_appearanceID = gff.getUint("Appearance", _appearanceID);

	// Static
	_static = gff.getBool("Static", _static);

	// Usable
	_usable = gff.getBool("Useable", _usable);

	// Locked
	_locked = gff.getBool("Locked", _locked);

	// Scripts
	readScripts(gff);
}
开发者ID:berenm,项目名称:xoreos,代码行数:28,代码来源:situated.cpp

示例3: loadProperties

void Situated::loadProperties(const Aurora::GFF3Struct &gff) {
	// Tag
	_tag = gff.getString("Tag", _tag);

	// Name
	_name = gff.getString("LocName", _name);

	// Description
	_description = gff.getString("Description", _description);

	// Appearance
	_appearanceID = gff.getUint("Appearance", _appearanceID);

	// Conversation
	_conversation = gff.getString("Conversation", _conversation);

	// Static
	_static = gff.getBool("Static", _static);

	// Usable
	_usable = gff.getBool("Useable", _usable);

	// Locked
	_locked = gff.getBool("Locked", _locked);

	// Tint
	readTint(gff, _tint);

	// Scripts and variables
	readScripts(gff);
	readVarTable(gff);
}
开发者ID:clone2727,项目名称:xoreos,代码行数:32,代码来源:situated.cpp

示例4: load

void Creature::load(const Aurora::GFF3Struct &creature) {
	Common::UString temp = creature.getString("ResRef");

	if (!temp.empty()) {
		try {
			Common::ScopedPtr<Aurora::GFF3File>
				cre(new Aurora::GFF3File(temp, Aurora::kFileTypeCRE, MKTAG('C', 'R', 'E', ' ')));

			loadBlueprint(cre->getTopLevel());

		} catch (Common::Exception &e) {
			e.add("Creature \"%s\" has no blueprint", temp.c_str());
			throw;
		}
	}

	// Tag
	_tag = creature.getString("Tag");

	// Appearance

	if (_appearance == Aurora::kFieldIDInvalid)
		throw Common::Exception("Creature without an appearance");

	loadAppearance();

	loadInstance(creature);
}
开发者ID:Supermanu,项目名称:xoreos,代码行数:28,代码来源:creature.cpp

示例5: loadARE

void Area::loadARE(const Aurora::GFF3Struct &are) {
	// Tag

	_tag = are.getString("Tag");

	// Name

	_name = are.getString("Name");
	if (!_name.empty() && (*--_name.end() == '\n'))
		_name.erase(--_name.end());

	_displayName = createDisplayName(_name);

	// Tiles

	_width  = are.getUint("Width");
	_height = are.getUint("Height");

	_tilesetName = are.getString("Tileset");

	_tiles.resize(_width * _height);

	loadTiles(are.getList("Tile_List"));

	// Scripts
	readScripts(are);
}
开发者ID:clone2727,项目名称:xoreos,代码行数:27,代码来源:area.cpp

示例6: loadProperties

void Creature::loadProperties(const Aurora::GFF3Struct &gff) {
	// Tag
	_tag = gff.getString("Tag", _tag);

	// Name
	_name = gff.getString("LocName", _name);

	// Description
	_description = gff.getString("Description", _description);

	// Portrait
	loadPortrait(gff);

	// Appearance
	_appearance = gff.getUint("Appearance_Type", _appearance);

	// Static
	_static = gff.getBool("Static", _static);

	// Usable
	_usable = gff.getBool("Useable", _usable);

	// PC
	_isPC = gff.getBool("IsPC", _isPC);

	// Scripts
	readScripts(gff);
}
开发者ID:clone2727,项目名称:xoreos,代码行数:28,代码来源:creature.cpp

示例7: loadBlueprint

void Trigger::loadBlueprint(const Aurora::GFF3Struct &gff) {
	Object::_tag = gff.getString("Tag");

	_name = gff.getString("LocalizedName");

	readScripts(gff);
}
开发者ID:Supermanu,项目名称:xoreos,代码行数:7,代码来源:trigger.cpp

示例8: loadObject

void Door::loadObject(const Aurora::GFF3Struct &gff) {
	// State

	_state = (State) gff.getUint("AnimationState", (uint) _state);

	// Linked to

	_linkedTo       = gff.getString("LinkedTo"    , _linkedTo);
	_linkedToModule = gff.getString("TargetModule", _linkedToModule);
}
开发者ID:clone2727,项目名称:xoreos,代码行数:10,代码来源:door.cpp

示例9: load

void Item::load(const Aurora::GFF3Struct &gff) {
	// Name and description
	_name = gff.getString("Name");
	_description = gff.getString("Description");

	// Base item
	_baseItem = gff.getSint("BaseItem");
	_itemClass = TwoDAReg.get2DA("baseitems").getRow(_baseItem).getString("itemclass");

	// Model variation
	_modelVariation = gff.getSint("ModelVariation");
}
开发者ID:berenm,项目名称:xoreos,代码行数:12,代码来源:item.cpp

示例10: loadProperties

void Waypoint::loadProperties(const Aurora::GFF3Struct &gff) {
	// Unique ID and tag

	_uniqueID = gff.getString("UniqueID", _uniqueID);
	_tag      = gff.getString("Tag", _tag);

	// Map note

	_hasMapNote = gff.getBool("HasMapNote", _hasMapNote);
	if (gff.hasField("MapNote"))
		gff.getLocString("MapNote", _mapNote);

	refreshLocalized();
}
开发者ID:Glyth,项目名称:xoreos,代码行数:14,代码来源:waypoint.cpp

示例11: loadProperties

void Waypoint::loadProperties(const Aurora::GFF3Struct &gff) {
	// Tag
	_tag = gff.getString("Tag", _tag);

	// Map note

	_hasMapNote     = gff.getBool("HasMapNote"    , _hasMapNote);
	_enabledMapNote = gff.getBool("MapNoteEnabled", _enabledMapNote);

	_mapNote = gff.getString("MapNote", _mapNote);

	// Scripts
	readScripts(gff);
}
开发者ID:berenm,项目名称:xoreos,代码行数:14,代码来源:waypoint.cpp

示例12: load

void Waypoint::load(const Aurora::GFF3Struct &waypoint) {
	// Tag

	_tag = waypoint.getString("Tag", _tag);

	loadPositional(waypoint);

	// Map note

	_hasMapNote = waypoint.getBool("MapNoteEnabled", _hasMapNote);
	_displayMapNote = waypoint.getBool("MapNoteDisplay", _displayMapNote);
	_mapNoteType = waypoint.getSint("MapNoteType");
	if (waypoint.hasField("MapNote")) {
		_mapNote = waypoint.getString("MapNote");
	}
}
开发者ID:clone2727,项目名称:xoreos,代码行数:16,代码来源:waypoint.cpp

示例13: load

void Trigger::load(const Aurora::GFF3Struct &gff) {
	Common::UString temp = gff.getString("TemplateResRef");

	Common::ScopedPtr<Aurora::GFF3File> utt;
	if (!temp.empty())
		utt.reset(loadOptionalGFF3(temp, Aurora::kFileTypeUTT, MKTAG('U', 'T', 'T', ' ')));

	loadBlueprint(utt->getTopLevel());

	if (!utt)
		warning("Trigger \"%s\" has no blueprint", temp.c_str());

	float x, y, z;
	x = (float)gff.getDouble("XPosition");
	y = (float)gff.getDouble("YPosition");
	z = (float)gff.getDouble("ZPosition");
	glm::vec3 position(x, y, z);
	setPosition(x, y, z);

	x = (float)gff.getDouble("XOrientation");
	y = (float)gff.getDouble("YOrientation");
	z = (float)gff.getDouble("ZOrientation");
	glm::vec3 orientation(x, y, z);

	const Aurora::GFF3List &geometry = gff.getList("Geometry");
	for (Aurora::GFF3List::const_iterator p = geometry.begin();
			p != geometry.end();
			++p) {
		x = (float)(*p)->getDouble("PointX");
		y = (float)(*p)->getDouble("PointY");
		z = (float)(*p)->getDouble("PointZ");
		_geometry.push_back(position + glm::vec3(x, y, z));
	}
}
开发者ID:Supermanu,项目名称:xoreos,代码行数:34,代码来源:trigger.cpp

示例14: loadInstance

void Trigger::loadInstance(const Aurora::GFF3Struct &gff) {
	// Tag

	_tag = gff.getString("Tag", _tag);

	loadPositional(gff);

	const Aurora::GFF3List &geometry = gff.getList("Geometry");
	float x, y, z;

	Graphics::VertexDecl vertexDecl;

	vertexDecl.push_back(Graphics::VertexAttrib(Graphics::VPOSITION, 3, GL_FLOAT));

	_vertexBuffer.setVertexDeclLinear(geometry.size(), vertexDecl);

	float *v = reinterpret_cast<float *>(_vertexBuffer.getData());
	for (uint32 i = 0; i < geometry.size(); i++) {
		geometry[i]->getVector("Vertex", x, y, z);

		// Position
		*v++ = x;
		*v++ = y;
		*v++ = z;
	}
}
开发者ID:clone2727,项目名称:xoreos,代码行数:26,代码来源:trigger.cpp

示例15: loadProperties

void Placeable::loadProperties(const Aurora::GFF3Struct &gff) {
	// Tag
	_tag = gff.getString("Tag", _tag);

	// Name and description
	gff.getLocString("LocName"     , _name);
	gff.getLocString("LocPopupText", _description);

	// Conversation
	_conversation = gff.getString("Conversation", _conversation);

	// Static and usable
	_static = !gff.getBool("Active" , !_static);
	_usable =  gff.getBool("Useable",  _usable);

	// Appearance
	_appearanceID = gff.getUint("Appearance", _appearanceID);

	// Position
	if (gff.hasField("XPosition")) {
		const float position[3] = {
			(float) gff.getDouble("XPosition"),
			(float) gff.getDouble("YPosition"),
			(float) gff.getDouble("ZPosition")
		};

		setPosition(position[0], position[1], position[2]);
	}

	// Orientation
	if (gff.hasField("XOrientation")) {
		const float orientation[4] = {
			(float) gff.getDouble("XOrientation"),
			(float) gff.getDouble("YOrientation"),
			(float) gff.getDouble("ZOrientation"),
			(float) Common::rad2deg(acos(gff.getDouble("WOrientation")) * 2.0)
		};

		setOrientation(orientation[0], orientation[1], orientation[2], orientation[3]);
	}

	// Variables and script
	readVarTable(gff);
	readScript(gff);
	enableEvents(true);
}
开发者ID:clone2727,项目名称:xoreos,代码行数:46,代码来源:placeable.cpp


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