public class Mower extends Object
Constructor and Description |
---|
Mower(int initialAbscissa,
int initialOrdinate,
Direction initialDirection,
MapArea map)
Standard constructor, will the mower at the given coordinates.
|
Mower(MapArea map)
Basic constructor, will place the mower at 0,0,N.
|
Modifier and Type | Method and Description |
---|---|
String |
drawPosition()
draw the current state of the mower and the map in a string, can be used on CLI.
|
Detector |
getDetector() |
String |
getStatistics()
Give the globals statistics of the mower.
|
void |
goBackward()
Will perform a check on the asked action and will move backward if there is no obstacle.
|
void |
goForward()
Will perform a check on the asked action and will move forward if there is no obstacle.
|
void |
turnLeft()
Ask the servomotor to turn left.
|
void |
turnRight()
Ask the servomotor to turn right.
|
public Mower(MapArea map)
map
- the map where to place the mowerpublic Mower(int initialAbscissa, int initialOrdinate, Direction initialDirection, MapArea map)
initialAbscissa
- the abscissa where to place the mowerinitialOrdinate
- the ordinate where to place the mowerinitialDirection
- the direction where the mower have to face at startmap
- the map where to place the mowerpublic void turnLeft()
public void turnRight()
public void goForward() throws UnsafeMoveException
UnsafeMoveException
- if an obstacle is detectedpublic void goBackward() throws UnsafeMoveException
UnsafeMoveException
- if an obstacle is detectedpublic String drawPosition()
public String getStatistics()
public Detector getDetector()
Copyright © 2016. All Rights Reserved.