Returns the y displacement of this direction.
(&self)
| 74 | |
| 75 | /// Returns the y displacement of this direction. |
| 76 | pub fn dy(&self) -> i32 { |
| 77 | match *self { |
| 78 | North => 1, |
| 79 | Northeast => 1, |
| 80 | East => 0, |
| 81 | Southeast => -1, |
| 82 | South => -1, |
| 83 | Southwest => -1, |
| 84 | West => 0, |
| 85 | Northwest => 1, |
| 86 | Center => 0, |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /// Whether this direction is a diagonal one. |
| 91 | pub fn is_diagonal(&self) -> bool { |
no outgoing calls
no test coverage detected