import java.io.IOException;

public abstract class Player {
    protected Position positionPlayer;
    protected GamingArea gArea;
    protected Game game;

    public Player (Position p, GamingArea g, Game ga) throws IOException {
        positionPlayer = p;
        gArea = g;
        game = ga;

        gArea.playingField[p.posX][p.posY] = p;
    }

    public abstract void movePlayer() throws IOException;

    public void movePlayer(Position pos)
    {
        if(positionPlayer.displayChar == pos.displayChar && !positionPlayer.equals(pos)) {
            positionPlayer.displayChar = DisplayChars.DEFAULT.getCharacter();
        }

        positionPlayer = pos;
    }
}
