* Converts direction to a vector. Direction starts north = 0 and goes clockwise. * @param direction Source direction. * @param vector Pointer to a position (which acts as a vector). */
| 486 | * @param vector Pointer to a position (which acts as a vector). |
| 487 | */ |
| 488 | void Pathfinding::directionToVector(const int direction, Position *vector) |
| 489 | { |
| 490 | int x[10] = {0, 1, 1, 1, 0, -1, -1, -1,0,0}; |
| 491 | int y[10] = {-1, -1, 0, 1, 1, 1, 0, -1,0,0}; |
| 492 | int z[10] = {0, 0, 0, 0, 0, 0, 0, 0, 1, -1}; |
| 493 | vector->x = x[direction]; |
| 494 | vector->y = y[direction]; |
| 495 | vector->z = z[direction]; |
| 496 | } |
| 497 | |
| 498 | /** |
| 499 | * Converts direction to a vector. Direction starts north = 0 and goes clockwise. |
no outgoing calls
no test coverage detected