| 255 | } |
| 256 | |
| 257 | static void ExtractStringParams(const StringData &data, StringParamsList ¶ms) |
| 258 | { |
| 259 | for (size_t i = 0; i < data.max_strings; i++) { |
| 260 | const LangString *ls = data.strings[i].get(); |
| 261 | |
| 262 | if (ls != nullptr) { |
| 263 | StringParams ¶m = params.emplace_back(); |
| 264 | ParsedCommandStruct pcs = ExtractCommandString(ls->english, false); |
| 265 | |
| 266 | for (auto it = pcs.consuming_commands.begin(); it != pcs.consuming_commands.end(); it++) { |
| 267 | if (*it == nullptr) { |
| 268 | /* Skip empty param unless a non empty param exist after it. */ |
| 269 | if (std::all_of(it, pcs.consuming_commands.end(), [](auto cs) { return cs == nullptr; })) break; |
| 270 | param.emplace_back(StringParam::UNUSED, 1); |
| 271 | continue; |
| 272 | } |
| 273 | const CmdStruct *cs = *it; |
| 274 | param.emplace_back(GetParamType(cs), cs->consumes, cs->cmd); |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | /** Compile the language. */ |
| 281 | void GameStrings::Compile() |
no test coverage detected