Generated with
This document is part of the ebook for O1 (aka CS-A1110 Programming 1), a course at Aalto University.
This document is part of the ebook for O1 (aka CS-A1110 Programming 1), a course at Aalto University.
o1.robots.Wall$
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
Reset zoom Hide graph Show graph
Supertypes
Self type
Members list
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
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
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
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