translate method

Direction translate(
  1. int x,
  2. int y
)

Returns a copy of this Direction, translated by x and y.

Implementation

Direction translate(int x, int y) => Direction(h + x, v + y);