Skip to content
Snippets Groups Projects
Commit 44d262b3 authored by Bariatti Francesco's avatar Bariatti Francesco
Browse files

Beginning of car implementation

parent 06d8db21
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,42 @@ package model; ...@@ -2,8 +2,42 @@ package model;
public class Car { public class Car {
private int number;
private Position front,back;
private Orientation orientation;
/**
* Move the car forward
* @param board the board on which apply the changes
* @param nbSteps the number of steps this car will move
* @throws RuntimeException If the number of steps is too high
*/
public void moveForward(int[][] board, int nbSteps) throws RuntimeException
{
if(this.getNbMovesForward(board) < nbSteps)
throw new RuntimeException("Illegal number of steps!");
//TODO
}
public int getNbMovesForward(int[][] board)
{
return 0;
}
public Position getFront() {
return front;
}
public Position getBack() {
return back;
}
public Orientation getOrientation() {
return orientation;
}
public enum Orientation {
HORIZONTAL, VERTICAL;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment