* Verifies this custom name is unique. Only custom names are checked. * @param name The name to check. * @return true if the name is unique */
| 2174 | * @return true if the name is unique |
| 2175 | */ |
| 2176 | static bool IsUniqueTownName(const std::string &name) |
| 2177 | { |
| 2178 | for (const Town *t : Town::Iterate()) { |
| 2179 | if (!t->name.empty() && t->name == name) return false; |
| 2180 | } |
| 2181 | |
| 2182 | return true; |
| 2183 | } |
| 2184 | |
| 2185 | /** |
| 2186 | * Create a new town. |
no test coverage detected