package de.htw_berlin.HoboOthello.core;


/**
 * Created by laura on 17.11.16.
 */
public class Field {

    private boolean empty;
    private boolean white;
    private boolean black;

    public Field(boolean empty, boolean white, boolean black) {
        this.empty = empty;
        this.white = white;
        this.black = black;
    }

    public boolean possibleForActualPlayer() {
        //Methode selbst muss noch geschrieben werden, return true if possible, false if not
        //hierfür brauche wir implentierte Spielregeln
        return true;
    }

    //getter und setter schon mal bereitgestellt, werden noch nicht benutzt!
    public boolean isEmpty() {
        return empty;
    }

    public boolean isWhite() {
        return white;
    }

    public boolean isBlack() {
        return black;
    }

    public void setEmpty(boolean empty) {
        this.empty = empty;
    }

    public void setWhite(boolean white) {
        this.white = white;
    }

    public void setBlack(boolean black) {
        this.black = black;
    }


}

@@ -188,94 +188,242 @@
     
-public Field(boolean empty, boolean white, boolean black) %7B%0A        this.empty = e
+/**%0A     * set an empty field%0A     */%0A    public Field() %7B%0A        setEmpty();%0A    %7D%0A%0A    public Field(boolean empty, boolean white, boolean black) %7B%0A        int tmp = 0;%0A%0A        if (empty) %7B%0A            tmp++;%0A            setE
 mpty
+()
 ;%0A  
@@ -432,55 +432,764 @@
     
-this.white = white;
+%7D%0A%0A        if (white) %7B%0A            tmp++;%0A            setWhite();%0A        %7D%0A%0A        if (black) %7B%0A            tmp++;%0A            setBlack();%0A        %7D%0A%0A        //todo show warning if (0 == tmp %7C%7C tmp %3E 1)%0A    %7D%0A%0A    /**%0A     * Add an field with just one possible condition%0A     * b == Black%0A     * w == White%0A     * everything else == empty%0A     *%0A     * @param FieldState b for Black field%0A     *                   w for White field
 %0A     
+*
    
-this.black = black;
+                e for empty field%0A     */%0A    public Field(char FieldState) %7B%0A        switch (FieldState) %7B%0A            case 'b':%0A                setBlack();%0A                break;%0A            case 'w':%0A                setWhite();%0A                break;%0A            default:%0A                setEmpty();%0A        %7D
 %0A   
@@ -1511,18 +1511,19 @@
 boolean 
-is
+get
 Empty() 
@@ -1539,16 +1539,21 @@
  return 
+this.
 empty;%0A 
@@ -1577,18 +1577,19 @@
 boolean 
-is
+get
 White() 
@@ -1605,16 +1605,21 @@
  return 
+this.
 white;%0A 
@@ -1643,18 +1643,19 @@
 boolean 
-is
+get
 Black() 
@@ -1671,16 +1671,21 @@
  return 
+this.
 black;%0A 
@@ -1686,32 +1686,390 @@
 ack;%0A    %7D%0A%0A    
+/**%0A     * get the current field state as an String%0A     *%0A     * @return the current field state %22empty%22, %22white%22, %22black%22%0A     */%0A    @Override%0A    public String toString() %7B%0A        if (this.empty) %7B%0A            return %22empty%22;%0A        %7D else if (this.white) %7B%0A            return %22white%22;%0A        %7D else %7B%0A            return %22black%22;%0A        %7D%0A    %7D%0A%0A    
 public void setE
@@ -2072,26 +2072,13 @@
 setE
-mpty(boolean e
 mpty
+(
 ) %7B%0A
@@ -2102,140 +2102,280 @@
 y = 
-empty;%0A    %7D%0A%0A    public void setWhite(boolean white) %7B%0A        this.white = white;%0A    %7D%0A%0A    public void setBlack(boolean black) %7B
+true;%0A        this.white = false;%0A        this.black = false;%0A    %7D%0A%0A    public void setWhite() %7B%0A        this.empty = false;%0A        this.white = true;%0A        this.black = false;%0A    %7D%0A%0A    public void setBlack() %7B%0A        this.empty = false;%0A        this.white = false;
 %0A   
@@ -2392,25 +2392,24 @@
 black = 
-black
+true
 ;%0A    %7D%0A
 %0A%0A%7D%0A
@@ -2404,12 +2404,10 @@
 ;%0A    %7D%0A
-%0A%0A
 %7D%0A

update getter & setter and add an security feature that only one field state is possible at a time