1.1 --- a/quoridor/src/main/java/cz/xelfi/quoridor/Move.java Thu Jan 07 22:34:17 2010 +0100
1.2 +++ b/quoridor/src/main/java/cz/xelfi/quoridor/Move.java Sun Sep 05 11:04:26 2010 +0200
1.3 @@ -27,7 +27,9 @@
1.4 package cz.xelfi.quoridor;
1.5
1.6 import cz.xelfi.quoridor.Player.Direction;
1.7 +import java.util.ArrayList;
1.8 import java.util.Arrays;
1.9 +import java.util.List;
1.10
1.11 /** Encapsulates one possible move that can be applied to existing {@link Board}
1.12 * by calling its {@link Board#apply} method.
1.13 @@ -221,4 +223,19 @@
1.14 }
1.15
1.16
1.17 + static List<Move> allMovements() {
1.18 + List<Move> arr = new ArrayList<Move>();
1.19 +
1.20 + arr.add(Move.EAST);
1.21 + arr.add(Move.WEST);
1.22 + arr.add(Move.NORTH);
1.23 + arr.add(Move.SOUTH);
1.24 +
1.25 + for (Direction d1 : Player.Direction.values()) {
1.26 + for (Direction d2 : Player.Direction.values()) {
1.27 + arr.add(Move.jump(d1, d2));
1.28 + }
1.29 + }
1.30 + return arr;
1.31 + }
1.32 }