Square
The trait Square represents squares in a robot world, as an abstract concept.
A square object is potentially mutable: its state can change as robots enter and exit it.
Two concrete kinds of squares have been implemented: Floors and Walls.
- See also:
Value members
Abstract methods
Adds the given robot to the square, if possible. If there is something already in the square, a collision happens instead.
Adds the given robot to the square, if possible. If there is something already in the square, a collision happens instead.
- Value parameters:
- arrivee
the robot arriving in the square
- Returns:
trueifarriveewas successfully placed in the square,falseif a collision occurred
Removes any robot from the square (if there was one there to begin with).
Removes any robot from the square (if there was one there to begin with).
Returns true if the square is completely empty (of robots and walls), false otherwise.
Returns true if the square is completely empty (of robots and walls), false otherwise.
