xoreos
0.0.5
|
LTR File, which is used when generating player names. More...
#include <ltrfile.h>
Classes | |
struct | LetterSet |
Public Member Functions | |
LTRFile (const Common::UString <r) | |
LTRFile (Common::SeekableReadStream &stream) | |
size_t | getLetterCount () const |
Get the letter count utilized by the ltr file. More... | |
Common::UString | generateRandomName (size_t maxLetters) const |
Generate a random name from the ltr file. More... | |
Public Member Functions inherited from Aurora::AuroraFile | |
AuroraFile () | |
void | clear () |
uint32 | getID () const |
Return the file's ID. More... | |
uint32 | getVersion () const |
Return the file's version. More... | |
bool | isUTF16LE () const |
Were the ID and version encoded in little-endian UTF-16 in the file? More... | |
Private Member Functions | |
void | load (Common::SeekableReadStream &stream) |
Private Attributes | |
Common::ScopedArray< char > | _alphabet |
uint8 | _letterCount |
LetterSet | _singleLetters |
Common::ScopedArray< LetterSet > | _doubleLetters |
Common::ScopedArray< Common::ScopedArray< LetterSet > > | _tripleLetters |
Additional Inherited Members | |
Static Public Member Functions inherited from Aurora::AuroraFile | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le) |
Read the header out of a stream. More... | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version) |
Read the ID and version out of a stream. More... | |
static uint32 | readHeaderID (Common::ReadStream &stream) |
Read the ID out of a stream. More... | |
Protected Member Functions inherited from Aurora::AuroraFile | |
void | readHeader (Common::ReadStream &stream) |
Static Protected Member Functions inherited from Aurora::AuroraFile | |
static uint32 | convertUTF16LE (uint32 x1, uint32 x2) |
Protected Attributes inherited from Aurora::AuroraFile | |
uint32 | _id |
The file's ID. More... | |
uint32 | _version |
The file's version. More... | |
bool | _utf16le |
The file's ID and version are in little-endian UTF-16. More... | |
LTR File, which is used when generating player names.
Information about the file structure was taken from https://github.com/mtijanic/nwn-misc
Aurora::LTRFile::LTRFile | ( | const Common::UString & | ltr | ) |
Definition at line 39 of file ltrfile.cpp.
References Aurora::kFileTypeLTR, load(), and ResMan.
Aurora::LTRFile::LTRFile | ( | Common::SeekableReadStream & | stream | ) |
Definition at line 44 of file ltrfile.cpp.
References load().
Common::UString Aurora::LTRFile::generateRandomName | ( | size_t | maxLetters | ) | const |
Generate a random name from the ltr file.
Definition at line 52 of file ltrfile.cpp.
References _alphabet, _doubleLetters, _letterCount, _singleLetters, _tripleLetters, Aurora::LTRFile::LetterSet::start, and Common::UString::toUpper().
Referenced by Engines::KotOR::CharacterGenerationNameMenu::callbackActive(), Engines::KotOR2::CharacterGenerationNameMenu::callbackActive(), Engines::KotOR2::CharacterGenerationInfo::createRandomFemaleConsular(), Engines::KotOR2::CharacterGenerationInfo::createRandomFemaleGuardian(), Engines::KotOR::CharacterGenerationInfo::createRandomFemaleScoundrel(), Engines::KotOR::CharacterGenerationInfo::createRandomFemaleScout(), Engines::KotOR2::CharacterGenerationInfo::createRandomFemaleSentinel(), Engines::KotOR::CharacterGenerationInfo::createRandomFemaleSoldier(), Engines::KotOR2::CharacterGenerationInfo::createRandomMaleConsular(), Engines::KotOR2::CharacterGenerationInfo::createRandomMaleGuardian(), Engines::KotOR::CharacterGenerationInfo::createRandomMaleScoundrel(), Engines::KotOR::CharacterGenerationInfo::createRandomMaleScout(), Engines::KotOR2::CharacterGenerationInfo::createRandomMaleSentinel(), and Engines::KotOR::CharacterGenerationInfo::createRandomMaleSoldier().
size_t Aurora::LTRFile::getLetterCount | ( | ) | const |
Get the letter count utilized by the ltr file.
Definition at line 48 of file ltrfile.cpp.
References _letterCount.
|
private |
Definition at line 121 of file ltrfile.cpp.
References _alphabet, _doubleLetters, Aurora::AuroraFile::_id, _letterCount, _singleLetters, _tripleLetters, Aurora::AuroraFile::_version, Common::debugTag(), Aurora::LTRFile::LetterSet::end, Common::ScopedPtrBase< T, Deallocator >::get(), kLetters26, kLetters28, kLTRID, Aurora::kVersion10, Aurora::LTRFile::LetterSet::mid, Common::ReadStream::readByte(), Aurora::AuroraFile::readHeader(), Common::ReadStream::readIEEEFloatLE(), Common::ScopedPtrBase< T, Deallocator >::reset(), and Aurora::LTRFile::LetterSet::start.
Referenced by LTRFile().
|
private |
Definition at line 64 of file ltrfile.h.
Referenced by generateRandomName(), and load().
|
private |
Definition at line 68 of file ltrfile.h.
Referenced by generateRandomName(), and load().
|
private |
Definition at line 65 of file ltrfile.h.
Referenced by generateRandomName(), getLetterCount(), and load().
|
private |
Definition at line 67 of file ltrfile.h.
Referenced by generateRandomName(), and load().
|
private |
Definition at line 69 of file ltrfile.h.
Referenced by generateRandomName(), and load().