1.1 --- a/quoridor/src/main/java/cz/xelfi/quoridor/Move.java Thu Sep 10 23:19:40 2009 +0200
1.2 +++ b/quoridor/src/main/java/cz/xelfi/quoridor/Move.java Thu Jan 07 22:34:17 2010 +0100
1.3 @@ -199,5 +199,26 @@
1.4 return hash;
1.5 }
1.6
1.7 + public Move getMirrorMove(){
1.8 + if(fence != null){
1.9 + return new Move(new Fence(16-fence.getX(), fence.getY(), fence.getOrientation()));
1.10 + }
1.11 + if(direction == null)
1.12 + return new Move();
1.13 + int dirSize = direction.length;
1.14 + Direction[] mirrorDirection = new Direction[dirSize];
1.15 + for(int i = 0; i < dirSize; i++){
1.16 + if(direction[i].equals(Direction.NORTH))
1.17 + mirrorDirection[i] = Direction.NORTH;
1.18 + else if(direction[i].equals(Direction.SOUTH))
1.19 + mirrorDirection[i] = Direction.SOUTH;
1.20 + else if(direction[i].equals(Direction.EAST))
1.21 + mirrorDirection[i] = Direction.WEST;
1.22 + else if(direction[i].equals(Direction.WEST))
1.23 + mirrorDirection[i] = Direction.EAST;
1.24 + }
1.25 + return new Move(mirrorDirection);
1.26 + }
1.27 +
1.28
1.29 }