Quote:
|
Originally Posted by Yen
Shouldn't you use 'else' in the 'overlaps' function??
|
Well, the last 4 you could combine to the first four, but only using an else if... other than that, they're checking four different coordinates on two different rectangles. Only case you could make to use else if is
if (first coordinate in first rectangle in second rectangle's range)
else if (first coordinate in second rectangle in first rectangle's range)
if (second coordinate in first rectangle in second rectangle's range)
else if (second coordinate in second rectangle in first rectangle's range)
or wait... yea you could... but I don't think it's quite necessary in a return bool function.