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.
Value members
Concrete methods
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.
- Value parameters:
- arrivee
the robot attempting to arrive in the square
- Returns:
false
since the robot’s arrival failed