17 enum ParamType : uint8_t {
28 StringParam(ParamType type, uint8_t consumes, std::string_view cmd = {}) : type(type), consumes(consumes), cmd(cmd) {}
30using StringParams = std::vector<StringParam>;
31using StringParamsList = std::vector<StringParams>;
40struct LanguageStrings {
49 bool IsValid()
const {
return !this->
language.empty(); }
64 GameStrings() =
default;
66 GameStrings(
const GameStrings &) =
delete;
67 GameStrings(GameStrings &&) =
delete;
68 GameStrings &operator=(
const GameStrings &) =
delete;
69 GameStrings &operator=(GameStrings &&) =
delete;
A sort-of mixin that implements 'at(pos)' and 'operator[](pos)' only for a specific type.
const std::string & GetGameStringName(StringIndexInTab id)
Get the name of a particular game string.
const StringParams & GetGameStringParams(StringIndexInTab id)
Get the string parameters of a particular game string.
void ReconsiderGameScriptLanguage()
Reconsider the game script language, so we use the right one.
void RegisterGameTranslation(class Squirrel &engine)
Register the current translation to the Squirrel engine.
std::string_view GetGameStringPtr(StringIndexInTab id)
Get the string pointer of a particular game string.
Types related to strings.
StrongType::Typedef< uint32_t, struct StringIndexInTabTag, StrongType::Compare, StrongType::Integer > StringIndexInTab
The index/offset of a string within a StringTab.
std::vector< LanguageStrings > raw_strings
The raw strings per language, first must be English/the master language!.
TypedIndexContainer< StringList, StringIndexInTab > string_names
The names of the compiled strings.
std::vector< LanguageStrings > compiled_strings
The compiled strings per language, first must be English/the master language!.
uint version
The version of the language strings.
void Compile()
Compile the language.
LanguageStrings * cur_language
The current (compiled) language.
TypedIndexContainer< StringParamsList, StringIndexInTab > string_params
The parameters for the strings.
Container for the raw (unencoded) language strings of a language.
std::string language
Name of the language (base filename). Empty string if invalid.
TypedIndexContainer< StringList, StringIndexInTab > lines
The lines of the file to pass into the parser/encoder.