* Get text to display for a given company slot. * @param cid Company to display. * @returns Text to display for company. */
| 167 | * @returns Text to display for company. |
| 168 | */ |
| 169 | std::string GetSlotText(CompanyID cid) const |
| 170 | { |
| 171 | if ((_game_mode != GM_NORMAL && cid == 0) || (_game_mode == GM_NORMAL && Company::IsValidHumanID(cid))) return GetString(STR_AI_CONFIG_HUMAN_PLAYER); |
| 172 | if (const AIInfo *info = AIConfig::GetConfig(cid)->GetInfo(); info != nullptr) return info->GetName(); |
| 173 | return GetString(STR_AI_CONFIG_RANDOM_AI); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Get colour to display text in for a given company slot. |
no test coverage detected