static */
| 61 | } |
| 62 | |
| 63 | /* static */ bool ScriptCompany::SetName(Text *name) |
| 64 | { |
| 65 | ScriptObjectRef counter(name); |
| 66 | |
| 67 | EnforceCompanyModeValid(false); |
| 68 | EnforcePrecondition(false, name != nullptr); |
| 69 | const std::string &text = name->GetDecodedText(); |
| 70 | EnforcePreconditionEncodedText(false, text); |
| 71 | EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_COMPANY_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); |
| 72 | |
| 73 | return ScriptObject::Command<CMD_RENAME_COMPANY>::Do(text); |
| 74 | } |
| 75 | |
| 76 | /* static */ std::optional<std::string> ScriptCompany::GetName(ScriptCompany::CompanyID company) |
| 77 | { |
nothing calls this directly
no test coverage detected