operator * method

Direction operator *(
  1. Object other
)

Implementation

Direction operator *(Object other) {
  if (other is Direction) {
    return Direction(h * other.h, v * other.v);
  }
  if (other is int) {
    return other == 1 ? this : Direction(h * other, v * other);
  }
  throw Exception('Direction can only be multiplied by an int or another'
      'Direction (tried to use ${other.runtimeType}).');
}