A normalized Coord has x and y == -1, 0, or 1. A normalized Coord may be used as an offset to one of the 8-neighbors. We'll convert the Coord into a Dir, then convert Dir to normalized Coord. */
| 82 | We'll convert the Coord into a Dir, then convert Dir to normalized Coord. |
| 83 | */ |
| 84 | Coord Coord::normalize() const |
| 85 | { |
| 86 | return asDir().asNormalizedCoord(); |
| 87 | } |
| 88 | |
| 89 | |
| 90 | // Effectively, we want to check if a coordinate lies in a 45 degree region (22.5 degrees each side) |