* Generate a random road block. * The probability of a straight road * is somewhat higher than a curved. * * @return A RoadBits value with 2 bits set */
| 1881 | * @return A RoadBits value with 2 bits set |
| 1882 | */ |
| 1883 | static RoadBits GenRandomRoadBits() |
| 1884 | { |
| 1885 | uint32_t r = Random(); |
| 1886 | uint a = GB(r, 0, 2); |
| 1887 | uint b = GB(r, 8, 2); |
| 1888 | if (a == b) b ^= 2; |
| 1889 | return (RoadBits)((ROAD_NW << a) + (ROAD_NW << b)); |
| 1890 | } |
| 1891 | |
| 1892 | /** |
| 1893 | * Grow the town. |