quoridor/src/main/java/cz/xelfi/quoridor/Board.java
changeset 237 38db4aae19d9
parent 219 d836818f5554
child 253 ee02205edf13
     1.1 --- a/quoridor/src/main/java/cz/xelfi/quoridor/Board.java	Sun Jan 17 14:36:03 2010 +0100
     1.2 +++ b/quoridor/src/main/java/cz/xelfi/quoridor/Board.java	Thu Apr 15 23:43:25 2010 +0200
     1.3 @@ -31,7 +31,6 @@
     1.4  import java.io.EOFException;
     1.5  import java.io.IOException;
     1.6  import java.io.Reader;
     1.7 -import java.io.StringReader;
     1.8  import java.io.Writer;
     1.9  import java.util.ArrayList;
    1.10  import java.util.Arrays;
    1.11 @@ -276,6 +275,9 @@
    1.12                      throw new IllegalPositionException ("You have to jump straight if there is no wall"); // NOI18N
    1.13                  }
    1.14                  arr[index] = newPosition (oneStep, where[1]);
    1.15 +                if (arr[index].equals(player)) {
    1.16 +                    throw new IllegalPositionException("You cannot jump forth and back"); // NOI18N
    1.17 +                }
    1.18                  return new Board (turn + 1, Arrays.asList (arr), fences);
    1.19              }
    1.20          }