static */
| 56 | } |
| 57 | |
| 58 | /* static */ bool ScriptGroup::SetName(GroupID group_id, Text *name) |
| 59 | { |
| 60 | ScriptObjectRef counter(name); |
| 61 | |
| 62 | EnforceCompanyModeValid(false); |
| 63 | EnforcePrecondition(false, IsValidGroup(group_id)); |
| 64 | EnforcePrecondition(false, name != nullptr); |
| 65 | const std::string &text = name->GetDecodedText(); |
| 66 | EnforcePreconditionEncodedText(false, text); |
| 67 | EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_GROUP_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); |
| 68 | |
| 69 | return ScriptObject::Command<CMD_ALTER_GROUP>::Do(AlterGroupMode::Rename, group_id, ::GroupID::Invalid(), text); |
| 70 | } |
| 71 | |
| 72 | /* static */ std::optional<std::string> ScriptGroup::GetName(GroupID group_id) |
| 73 | { |
nothing calls this directly
no test coverage detected