operator + method

Vec2 operator +(
  1. Object other
)

Implementation

Vec2 operator +(Object other) {
  if (other is VectorBase) {
    return Vec2(x + other.x, y + other.y);
  } else if (other is int) {
    return Vec2(x + other, y + other);
  } else {
    throw ArgumentError('Argument must be a VectorBase or an int');
  }
}