* It can be thought of as a point in the automap or overview map or waypoint.

- * By convention, adding, multiplying etc. a point with another one only works

- * when both originate from the very same map.

+ * Adding and subtracting a point with another one only works when both originate from

case class MapPoint private(

MapPoint.checkMapBoundsViolationOf(this)

- def + (that: MapPoint) = MapPoint(map, x + that.x, y + that.y)

- def - (that: MapPoint) = MapPoint(map, x - that.x, y - that.y)

+ def + (that: MapPoint) = {

+ require(map == that.map)

+ MapPoint(map, x + that.x, y + that.y)

+ def - (that: MapPoint) = {

+ require(map == that.map)

+ MapPoint(map, x - that.x, y - that.y)

def * (amount: Double) = MapPoint(map, x * amount, y * amount)

def isNear (that: MapPoint) =

def checkMapBoundsViolationOf(point: MapPoint) = {

require(laysInBounds(point.map, point.x, point.y),

- "Point (" + point.x + ", " + point.y + ") is out of bounds (" +~~ ~~

+ "Point (" + point.x + ", " + point.y + ") is out of bounds (" +

point.map.width + "x" + point.map.height + ")")