Codechange: make the StringIndex (within a StringTab) a strong type

This commit is contained in:
Rubidium
2025-01-02 09:03:38 +01:00
committed by rubidium42
parent 2d372fa516
commit fd7a883cbd
10 changed files with 44 additions and 37 deletions

View File

@@ -132,13 +132,13 @@ private:
using Param = std::variant<SQInteger, std::string, ScriptTextRef>;
struct ParamCheck {
StringID owner;
StringIndexInTab owner;
int idx;
Param *param;
bool used = false;
const char *cmd = nullptr;
ParamCheck(StringID owner, int idx, Param *param) : owner(owner), idx(idx), param(param) {}
ParamCheck(StringIndexInTab owner, int idx, Param *param) : owner(owner), idx(idx), param(param) {}
void Encode(std::back_insert_iterator<std::string> &output, const char *cmd);
};
@@ -146,7 +146,7 @@ private:
using ParamList = std::vector<ParamCheck>;
using ParamSpan = std::span<ParamCheck>;
StringID string;
StringIndexInTab string;
std::array<Param, SCRIPT_TEXT_MAX_PARAMETERS> param = {};
int paramc = 0;