* Assign the town layout. * @param layout The desired layout. If TL_RANDOM, we pick one based on TileHash. */
| 187 | * @param layout The desired layout. If TL_RANDOM, we pick one based on TileHash. |
| 188 | */ |
| 189 | void Town::InitializeLayout(TownLayout layout) |
| 190 | { |
| 191 | if (layout != TL_RANDOM) { |
| 192 | this->layout = layout; |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | this->layout = static_cast<TownLayout>(TileHash(TileX(this->xy), TileY(this->xy)) % (NUM_TLS - 1)); |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Return a random valid town. |
no test coverage detected