public static Backend.Coords DirectionTile(Coords start, Direction dir)
{
switch (dir)
{
case Direction.Left:
return new Backend.Coords(start.x - 1, start.y);
case Direction.Right:
return new Backend.Coords(start.x + 1, start.y);
case Direction.Down:
return new Backend.Coords(start.x, start.y + 1);
case Direction.Up:
return new Backend.Coords(start.x, start.y - 1);
case Direction.DownLeft:
return new Backend.Coords(start.x - 1, start.y + 1);
case Direction.UpRight:
return new Backend.Coords(start.x + 1, start.y - 1);
case Direction.DownRight:
return new Backend.Coords(start.x + 1, start.y + 1);
case Direction.UpLeft:
return new Backend.Coords(start.x - 1, start.y - 1);
}
return start;
}