| CBLanguageTable is a class designed to support in-game artificial
Languages such as Elvish, Orcish, or Klingon. |
| |
| This class is used by ChatBlade to replace Chat Text with artificial
words from the Fantasy/Sci-Fi Language when a Player receives Chat in a
Language their Character does not fully comprehend. |
| |
| Each in-game Fantasy/Sci-Fi Language is represented by a single
instance of a CBLanguageTable. |
| A Map of all the instances for the Languages used in a game is stored
in CBChatHandler::m_LanguageTableMap. |
| This Map is keyed via the LanguageID of a Language. Each in-game
Language should have a separate LanguageID. |
| |
| Developers should create an instance of CBLanguageTable and fill it
full of artificial words of the target Language via the AddWord() member
Function. |
| This should be done in the CBClientImplementation::LoadLanguageTables()
function which ChatBlade invokes in response to CBChatHandler::InitializeChat(). |
| |
| A sample of creating an loading a CBLanguageTable instance is shown in
CBSampleImplementation::LoadLanguageTables(). |
| CBSampleImplementation::LoadLanguageTables()
shows the creation of a CBLanguageTable instance then the loading of
that instance of numerous Elvish sounding words which are read in from Elvish.XML. |
| The instance is then placed into the ChatBlade map of CBLanguageTable
instances by calling the static function CBLanguageTable::AddLanguageTable()
which puts the instance into CBData::pChatHandler->m_LanguageTableMap[CB_LANGUAGE_ELVISH].
|
| |
| Game Developers should load their Language Table instances with words
which emulate imagined words from the target Language. |
| Words of varying lengths should be added. |
| ChatBlade divides the added words into 3 groups; those 3 letters or
shorter, those 7 letters or longer, and words of medium
length. |
| CBLanguageTable is designed to support European based character
sets. |
| |
| This class endeavors to always use the same Fantasy word when
replacing typed real words. |
| So the word Happy should always map up to the same artificial
word. |
| ChatBlade endeavors to ignore any punctuation in a word (Happy,
Happy. and Happ!@$y all should map to the same word). |
| Language word Conversion is done on a word by word basis and does not
work on phrases. |
| |
| When a Player receives a Chat Message that is in a Language his
Character does not fully comprehend, ChatBlade shall replace typed words
in that Chat Message with Fantasy words stored in this class (the
instance with the matching LanguageID to that of the Chat
Message). |
| ChatBlade allows for partial knowledge of a Language. In such
cases ChatBlade shall only convert a proportional amount of words into
the Fantasy Language. |
| ChatBlade calls CBClientImplementation::GetLanguageKnowledgeLevel()
to determine how much a Character understands a target Language.
This function should return a value of 0 - 100 with 100 representing
full fluency. |
| If a Character is fully fluent in a Language, no Language conversion
shall occur. |
| |
| ChatBlade shall do no Language Conversion on any HyperLinks found in a
Chat Message. |
| |