static */
| 42 | } |
| 43 | |
| 44 | /* static */ bool ScriptBaseStation::SetName(StationID station_id, Text *name) |
| 45 | { |
| 46 | ScriptObjectRef counter(name); |
| 47 | |
| 48 | EnforceCompanyModeValid(false); |
| 49 | EnforcePrecondition(false, IsValidBaseStation(station_id)); |
| 50 | EnforcePrecondition(false, name != nullptr); |
| 51 | const std::string &text = name->GetDecodedText(); |
| 52 | EnforcePreconditionEncodedText(false, text); |
| 53 | EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_STATION_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); |
| 54 | |
| 55 | if (::Station::IsValidID(station_id)) { |
| 56 | return ScriptObject::Command<CMD_RENAME_STATION>::Do(station_id, text); |
| 57 | } else { |
| 58 | return ScriptObject::Command<CMD_RENAME_WAYPOINT>::Do(station_id, text); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | /* static */ TileIndex ScriptBaseStation::GetLocation(StationID station_id) |
| 63 | { |
nothing calls this directly
no test coverage detected