isSameYDirection method

bool isSameYDirection(
  1. double y
)

Implementation

bool isSameYDirection(double y) {
  if (y > 0 && (this == down || this == downRight || this == downLeft)) {
    return true;
  }

  if (y < 0 && (this == up || this == upRight || this == upLeft)) {
    return true;
  }
  return false;
}