public interface MowerController
| Modifier and Type | Method and Description |
|---|---|
void |
addMower(MapArea map,
int abscissa,
int ordinate)
Add a new mower in the map at the x y coordinate.
|
void |
addMower(MapArea map,
Mower mower)
Add a new mower in the map at the x y coordinate.
|
MapArea |
createMap(int x,
int y)
Create a new empty map and add it to the mowerMapsList.
|
MapArea |
executeFileCommands(List<String> fileContent)
Create a new map, its mowers and their commands and execute it all.
|
void |
executesCommands(Mower mower,
char abbreviation)
Make the mower executes the command.
|
void |
executesCommands(Mower mower,
MowerCommands command)
Make the mower executes the command.
|
void |
executesCommands(Mower mower,
String commandLine)
Make the mower execute the command line.
|
MapArea |
fetchMapFromIndex(int index)
Get the map located at the provided index.
|
Mower |
fetchMowerFromCoordinates(MapArea map,
int x,
int y)
Return the mower presents in the map at coordinate x y.
|
int |
getMapIndex(MapArea map)
Get the map index.
|
Map<MapArea,Map<Mower,String>> |
getMapMowersList()
Get the complete list of the Map and the mowers and their commands line.
|
int |
getMowerIndex(MapArea map,
Mower mower)
Get the mower's addition number.
|
List<Map.Entry<Mower,MowerCommands>> |
getProgramHistoric()
Get the full historic of the program.
|
void |
removeMower(MapArea map,
int abscissa,
int ordinate)
Remove the mower from the map.
|
void |
reset()
Empty all the data.
|
Mower fetchMowerFromCoordinates(MapArea map, int x, int y)
map - the map where to find the mowerx - the abscissa to seeky - the ordinate to seekvoid addMower(MapArea map, int abscissa, int ordinate)
map - the map where to put the mowerabscissa - the abscissa to put the mowerordinate - the ordinate to put the mowervoid addMower(MapArea map, Mower mower)
map - the map where to put the mowermower - the mower to addint getMowerIndex(MapArea map, Mower mower)
map - the map where the mower is supposed to be.mower - the mower to findvoid executesCommands(Mower mower, String commandLine) throws ImpossibleMowerCommandException
mower - the mower which wille execute the commandscommandLine - the commands to executeUnknownMowerCommandException - if asked command is nullImpossibleMowerCommandExceptionMapArea executeFileCommands(List<String> fileContent) throws ImpossibleMowerCommandException, MowerInstructionFileException
fileContent - the mower which will execute the commandMowerInstructionFileException - if file is bad formattedUnknownMowerCommandException - if command doesn't exists or is nullImpossibleMowerCommandExceptionvoid executesCommands(Mower mower, char abbreviation) throws ImpossibleMowerCommandException
mower - the mower which will execute the commandabbreviation - the character which correspond to a commandUnknownMowerCommandException - if command doesn't existsImpossibleMowerCommandExceptionvoid executesCommands(Mower mower, MowerCommands command) throws ImpossibleMowerCommandException
mower - the mower which will execute the commandcommand - the command to executeUnknownMowerCommandException - if command doesn't existsImpossibleMowerCommandExceptionList<Map.Entry<Mower,MowerCommands>> getProgramHistoric()
Map<MapArea,Map<Mower,String>> getMapMowersList()
MapArea fetchMapFromIndex(int index)
index - the map's index to getMapArea createMap(int x, int y)
x - the map's widthy - the map's heightint getMapIndex(MapArea map)
map - the map to looks forvoid reset()
void removeMower(MapArea map, int abscissa, int ordinate)
map - the map where to do the withdrawalabscissa - the supposed abscissa of the mowerordinate - the supposed ordinate of the mowerCopyright © 2016. All Rights Reserved.