Returns the x displacement of this direction.
(&self)
| 59 | |
| 60 | /// Returns the x displacement of this direction. |
| 61 | pub fn dx(&self) -> i32 { |
| 62 | match *self { |
| 63 | North => 0, |
| 64 | Northeast => 1, |
| 65 | East => 1, |
| 66 | Southeast => 1, |
| 67 | South => 0, |
| 68 | Southwest => -1, |
| 69 | West => -1, |
| 70 | Northwest => -1, |
| 71 | Center => 0, |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /// Returns the y displacement of this direction. |
| 76 | pub fn dy(&self) -> i32 { |
no outgoing calls
no test coverage detected