interface Environment2DWithObstacles<W : Obstacle2D!, T : Any!, P : Position<out P>!> : Environment<T, P>
addObstacle |
Adds an abstract fun addObstacle(o: W): Unit |
getObstacles |
abstract fun getObstacles(): MutableList<W>! |
getObstaclesInRange |
Given a point and a range, retrieves all the obstacles within. abstract fun getObstaclesInRange(centerx: Double, centery: Double, range: Double): MutableList<W>! |
hasMobileObstacles |
abstract fun hasMobileObstacles(): Boolean |
intersectsObstacle |
Checks whether there is at least an obstacle intersecting the line connecting [sx, sy] and [ex, ey]. abstract fun intersectsObstacle(sx: Double, sy: Double, ex: Double, ey: Double): Boolean
Checks whether there is at least an obstacle intersecting the line connecting p1 and p2. abstract fun intersectsObstacle(p1: P, p2: P): Boolean |
next |
This method must calculate the RELATIVE next allowed position given the current position and the position in which the node wants to move. For example, if your node is in position [2,3], wants to move to [3,4] but the next allowed position (because, e.g., of physical obstacles) is [2.5,3.5], the result must be a abstract fun next(ox: Double, oy: Double, nx: Double, ny: Double): P |
removeObstacle |
Removes an abstract fun removeObstacle(o: W): Boolean |