static */
| 82 | } |
| 83 | |
| 84 | /* static */ bool ScriptCompany::SetPresidentName(Text *name) |
| 85 | { |
| 86 | ScriptObjectRef counter(name); |
| 87 | |
| 88 | EnforceCompanyModeValid(false); |
| 89 | EnforcePrecondition(false, name != nullptr); |
| 90 | const std::string &text = name->GetDecodedText(); |
| 91 | EnforcePreconditionEncodedText(false, text); |
| 92 | EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_PRESIDENT_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); |
| 93 | |
| 94 | return ScriptObject::Command<CMD_RENAME_PRESIDENT>::Do(text); |
| 95 | } |
| 96 | |
| 97 | /* static */ std::optional<std::string> ScriptCompany::GetPresidentName(ScriptCompany::CompanyID company) |
| 98 | { |
nothing calls this directly
no test coverage detected