package ships.model;

import java.util.Objects;

/**
 * @author Mateusz Kozlowski
 */
public class FieldImpl implements Field {

    private Boolean attacked;
    private State state;
    private int row, col;

    public FieldImpl(State state, int row, int col) {
        this.state = state;
        this.row = row;
        this.col = col;
    }

    public int getRow() {
        return row;
    }

    public int getCol() {
        return col;
    }

    public Boolean isShipHere() {
        return state == State.SHIP;
    }

    public Boolean isAttacked() {
        return attacked;
    }

    public void setState(State state) {
        this.state = state;
    }

    public State getState() {
        return state;
    }

    public void attack() {
        this.attacked = true;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        FieldImpl field = (FieldImpl) o;
        return row == field.row
                && col == field.col
                && Objects.equals(attacked, field.attacked)
                && state == field.state;
    }

    @Override
    public int hashCode() {
        return Objects.hash(attacked, state, row, col);
    }
}

@@ -342,193 +342,619 @@
     
-%7D%0A%0A    public int getRow() %7B%0A        return row;%0A    %7D%0A%0A    public int getCol() %7B%0A        return col;%0A    %7D%0A%0A    public Boolean isShipHere() %7B%0A        return state == State.SHIP;%0A    %7D%0A
+    this.attacked = Boolean.FALSE;%0A    %7D%0A%0A    public FieldImpl(int row, int col) %7B%0A        this.state = State.EMPTY;%0A        this.row = row;%0A        this.col = col;%0A        this.attacked = Boolean.FALSE;%0A    %7D%0A%0A    public int getRow() %7B%0A        return row;%0A    %7D%0A%0A    public int getCol() %7B%0A        return col;%0A    %7D%0A%0A    /**%0A     * Informs if field is occuped by a ship%0A     *%0A     * @return%0A     */%0A    public Boolean isShipHere() %7B%0A        return state == State.SHIP;%0A    %7D%0A%0A    /**%0A     * Informs if field had been already shot by opponent%0A     *%0A     * @return %3Cb%3Etrue%3C/b%3E if field had been attacked%0A     */
 %0A   
@@ -1008,32 +1008,85 @@
 ttacked;%0A    %7D%0A%0A
+    /**%0A     * @param state the state to set%0A     */%0A
     public void 

Add second constructor for Field implementation