Wall

o1.robots.Wall$
object Wall extends Square

The singleton object Wall represents walls, that is, squares that constitute unpassable barriers for robots. A robot can never be in the same location with a wall.

Since all wall locations in all robot worlds are alike and immutable, it is enough to have a single Wall object that can be placed anywhere in any robot world. There is no need for separate instances for each wall square.

Attributes

Graph
Supertypes
trait Square
class Object
trait Matchable
class Any
Self type
Wall.type

Members list

Value members

Concrete methods

def addRobot(arrivee: RobotBody): Boolean

Fails to add the given robot to the square. Instead, the robot collides with the wall and is destroyed.

Fails to add the given robot to the square. Instead, the robot collides with the wall and is destroyed.

Parameters

arrivee

the robot attempting to arrive in the square

Attributes

Returns

false since the robot’s arrival failed

def clear(): Unit

Does nothing, since there is no robot to remove in a wall square.

Does nothing, since there is no robot to remove in a wall square.

Attributes

Inherited methods

Returns true if the square contains any robot or wall, false otherwise.

Returns true if the square contains any robot or wall, false otherwise.

Attributes

Inherited from:
Square

Concrete fields

false since there is a wall

false since there is a wall

Attributes

true since a wall is an unpassable barrier

true since a wall is an unpassable barrier

Attributes

None since there is never any robot in a wall square

None since there is never any robot in a wall square

Attributes