本文整理汇总了C++中aurora::LocString::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ LocString::getString方法的具体用法?C++ LocString::getString怎么用?C++ LocString::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurora::LocString
的用法示例。
在下文中一共展示了LocString::getString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stream
GTEST_TEST_F(LocString, readLocString) {
static const byte kData[] = { 0x17, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00,
0x46, 0xC3, 0xB6, 0xC3, 0xB6, 0x62, 0xC3, 0xA4,
0x72, 0x30, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00,
0x00, 0x00, 0x46, 0xC3, 0xB6, 0xC3, 0xB6, 0x62,
0xC3, 0xA4, 0x72, 0x31 };
Common::MemoryReadStream stream(kData);
Aurora::LocString locString;
locString.readLocString(stream);
EXPECT_EQ(locString.getID(), 23);
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ));
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale));
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ).c_str(),
kUTF8String0);
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale).c_str(),
kUTF8String1);
EXPECT_STREQ(locString.getFirstString().c_str(), kUTF8String0);
EXPECT_STREQ(locString.getString().c_str(), kUTF8String0);
}
示例2: 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);
}
示例3: loadProperties
void Creature::loadProperties(const Aurora::GFFStruct &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();
}
// Portrait
loadPortrait(gff);
// Appearance
_appearance = gff.getUint("Appearance_Type", _appearance);
// Static
_static = gff.getBool("Static", _static);
// Usable
_usable = gff.getBool("Useable", _usable);
}
示例4: loadARE
void Area::loadARE(const Aurora::GFFStruct &are) {
// Name
Aurora::LocString name;
are.getLocString("Name", name);
_name = name.getString();
}
示例5:
GTEST_TEST_F(LocString, setString) {
Aurora::LocString locString;
locString.setString(Aurora::kLanguageEnglish, kUTF8String);
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ));
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale));
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ).c_str(),
kUTF8String);
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale).c_str(),
kUTF8String);
EXPECT_STREQ(locString.getFirstString().c_str(), kUTF8String);
EXPECT_STREQ(locString.getString().c_str(), kUTF8String);
}
示例6: stream
GTEST_TEST_F(LocString, unknownEncodingUTF8) {
static const byte kData[] = { 0x09, 0x00, 0x00, 0x00, 0x46, 0xC3, 0xB6, 0xC3,
0xB6, 0x62, 0xC3, 0xA4, 0x72 };
Common::MemoryReadStream stream(kData);
Aurora::LocString locString;
locString.readString(4, stream);
EXPECT_STREQ(locString.getString().c_str(), "[???]");
}
示例7: loadProperties
void Situated::loadProperties(const Aurora::GFFStruct &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();
}
// Portrait
loadPortrait(gff);
// 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);
// Scripts
readScripts(gff);
}
示例8: loadProperties
void Waypoint::loadProperties(const Aurora::GFFStruct &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();
}
}