Skip to content
Snippets Groups Projects
Car.java 935 B
Newer Older
Bariatti Francesco's avatar
Bariatti Francesco committed
package model;


public class Car {
    private int number;
    private Position front,back;
    private Orientation orientation;
Bariatti Francesco's avatar
Bariatti Francesco committed

    /**
     * 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
    }
Bariatti Francesco's avatar
Bariatti Francesco committed

    public int getNbMovesForward(int[][] board)
    {
        return 0;
    }
Bariatti Francesco's avatar
Bariatti Francesco committed

    public Position getFront() {
        return front;
    }

    public Position getBack() {
        return back;
    }

    public Orientation getOrientation() {
        return orientation;
    }

    public enum Orientation {
        HORIZONTAL, VERTICAL;
    }