本文整理汇总了C++中aurora::GFF3Struct::getLocString方法的典型用法代码示例。如果您正苦于以下问题:C++ GFF3Struct::getLocString方法的具体用法?C++ GFF3Struct::getLocString怎么用?C++ GFF3Struct::getLocString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurora::GFF3Struct
的用法示例。
在下文中一共展示了GFF3Struct::getLocString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: loadARE
void Area::loadARE(const Aurora::GFF3Struct &are) {
// Name
Aurora::LocString name;
are.getLocString("Name", name);
_name = name.getString();
}
示例3: 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);
}
示例4: loadProperties
void Situated::loadProperties(const Aurora::GFF3Struct &gff) {
// Unique ID and tag
_uniqueID = gff.getString("UniqueID", _uniqueID);
_tag = gff.getString("Tag", _tag);
// Name
if (gff.hasField("LocName")) {
try {
gff.getLocString("LocName", _name);
} catch (...) {
}
}
// Description
if (gff.hasField("Description")) {
try {
gff.getLocString("Description", _description);
} catch (...) {
}
}
refreshLocalized();
// Appearance
_modelName = gff.getString("ModelName", _modelName);
// Sounds
_soundAppType = gff.getUint("SoundAppType", _soundAppType);
// Conversation
_conversation = gff.getString("Conversation", _conversation);
// Static
_static = gff.getBool("Static", _static);
// Usable
_usable = gff.getBool("Useable", _usable);
// Locked
_locked = gff.getBool("Locked", _locked);
}
示例5: loadProperties
void Situated::loadProperties(const Aurora::GFF3Struct &gff) {
// Tag
_tag = gff.getString("Tag", _tag);
// Name
if (gff.hasField("LocName")) {
Aurora::LocString name;
gff.getLocString("LocName", name);
_name = name.getString();
}
// Description
if (gff.hasField("Description")) {
Aurora::LocString description;
gff.getLocString("Description", description);
_description = description.getString();
}
// 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);
}
示例6: 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();
}
示例7: load
void Creature::load(const Aurora::GFF3Struct &utc) {
// Unique ID and tag
_uniqueID = utc.getString("UniqueID", _uniqueID);
_tag = utc.getString("Tag", _tag);
// Name
utc.getLocString("FirstName", _name);
// Description
utc.getLocString("Description", _description);
// Static
_static = false;
// Usable
_static = true;
// PC
_isPC = utc.getBool("IsPC", _isPC);
// Scripts
readScripts(utc);
}
示例8: loadProperties
void Waypoint::loadProperties(const Aurora::GFF3Struct &gff) {
// Tag
_tag = gff.getString("Tag", _tag);
// Map note
_hasMapNote = gff.getBool("MapNoteEnabled", _hasMapNote);
if (gff.hasField("MapNote")) {
Aurora::LocString mapNote;
gff.getLocString("MapNote", mapNote);
_mapNote = mapNote.getString();
}
}
示例9: load
void Waypoint::load(const Aurora::GFF3Struct &waypoint) {
// Tag
_tag = waypoint.getString("Tag");
// Group
_group = waypoint.getSint("Group", -1);
// Map Note
_hasMapNote = waypoint.getBool("HasMapNote");
_enabledMapNote = waypoint.getBool("MapNoteEnabled");
waypoint.getLocString("MapNote", _mapNote);
// Type
_type = (uint32) ((int32) waypoint.getSint("MapNoteType", -1));
// Position
const float position[3] = {
(float) waypoint.getDouble("XPosition"),
(float) waypoint.getDouble("YPosition"),
(float) waypoint.getDouble("ZPosition")
};
setPosition(position[0], position[1], position[2]);
// Orientation
const float orientation[4] = {
(float) waypoint.getDouble("XOrientation"),
(float) waypoint.getDouble("YOrientation"),
(float) waypoint.getDouble("ZOrientation"),
(float) Common::rad2deg(acos(waypoint.getDouble("WOrientation")) * 2.0)
};
setOrientation(orientation[0], orientation[1], orientation[2], orientation[3]);
const Aurora::GDAFile &gda = getMGDA(kWorksheetWaypoints);
// Icon
_icon = gda.getString(_type, "Icon");
// Variables and script
readVarTable(waypoint);
readScript(waypoint);
enableEvents(true);
}
示例10: loadARE
void Area::loadARE(const Aurora::GFF3Struct &are) {
// Tag
_tag = are.getString("Tag");
// Name
are.getLocString("Name", _name);
refreshLocalized();
// Generic properties
if (are.hasField("AreaProperties"))
loadProperties(are.getStruct("AreaProperties"));
// Area geometry model
_modelName = are.getString("Tileset");
// Scripts
readScripts(are);
}
示例11: catch
void GFF3Dumper::dumpField(const Aurora::GFF3Struct &strct, const Common::UString &field) {
Aurora::GFF3Struct::FieldType type = strct.getType(field);
Common::UString typeName;
if (((size_t) type) < ARRAYSIZE(kGFF3FieldTypeNames))
typeName = kGFF3FieldTypeNames[(int)type];
else
typeName = "filetype" + Common::composeString((uint64) type);
Common::UString label = field;
// Structs already open their own tag
if (type != Aurora::GFF3Struct::kFieldTypeStruct) {
_xml->openTag(typeName);
_xml->addProperty("label", label);
}
switch (type) {
case Aurora::GFF3Struct::kFieldTypeChar:
_xml->setContents(Common::composeString(strct.getUint(field)));
break;
case Aurora::GFF3Struct::kFieldTypeByte:
case Aurora::GFF3Struct::kFieldTypeUint16:
case Aurora::GFF3Struct::kFieldTypeUint32:
case Aurora::GFF3Struct::kFieldTypeUint64:
_xml->setContents(Common::composeString(strct.getUint(field)));
break;
case Aurora::GFF3Struct::kFieldTypeSint16:
case Aurora::GFF3Struct::kFieldTypeSint32:
case Aurora::GFF3Struct::kFieldTypeSint64:
_xml->setContents(Common::composeString(strct.getSint(field)));
break;
case Aurora::GFF3Struct::kFieldTypeFloat:
case Aurora::GFF3Struct::kFieldTypeDouble:
_xml->setContents(Common::UString::format("%.6f", strct.getDouble(field)));
break;
case Aurora::GFF3Struct::kFieldTypeStrRef:
_xml->setContents(strct.getString(field));
break;
case Aurora::GFF3Struct::kFieldTypeExoString:
case Aurora::GFF3Struct::kFieldTypeResRef:
try {
_xml->setContents(strct.getString(field));
} catch (...) {
_xml->addProperty("base64", "true");
Common::SeekableReadStream *data = strct.getData(field);
_xml->setContents(*data);
delete data;
}
break;
case Aurora::GFF3Struct::kFieldTypeLocString:
{
Aurora::LocString locString;
strct.getLocString(field, locString);
_xml->addProperty("strref", Common::composeString(locString.getID()));
dumpLocString(locString);
}
break;
case Aurora::GFF3Struct::kFieldTypeVoid:
_xml->setContents(*strct.getData(field));
break;
case Aurora::GFF3Struct::kFieldTypeStruct:
dumpStruct(strct.getStruct(field), label);
break;
case Aurora::GFF3Struct::kFieldTypeList:
dumpList(strct.getList(field));
break;
case Aurora::GFF3Struct::kFieldTypeOrientation:
{
double a = 0.0, b = 0.0, c = 0.0, d = 0.0;
strct.getOrientation(field, a, b, c, d);
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", a));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", b));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", c));
//.........这里部分代码省略.........