PrologNextMovement

class Object
trait Matchable
class Any

Value members

Concrete methods

def calculateNextMovement(currPosition: Point2D, worldWidth: Int, worldHeight: Int, step: Int): Set[Point2D]

Calculates all possible next movement based on current position

Calculates all possible next movement based on current position

Value parameters:
currPosition

the current position of the entity

step

the step of the movement

worldHeight

the height of the world

worldWidth

the width of the world

Returns:

a set of possible next position

def calculateNextMovementToGoHome(currPosition: Point2D, worldWidth: Int, worldHeight: Int, step: Int, homePos: Point2D): Set[Point2D]

Calculates all possible next movement for entity that has to return to home

Calculates all possible next movement for entity that has to return to home

Value parameters:
currPosition

the current position of the entity

homePos

the position of the home

step

the step of the movement

worldHeight

the height of the world

worldWidth

the width of the world

Returns:

a set of possible next position

Concrete fields

val newX: Var
val newY: Var