# HG changeset patch # User Matti Hamalainen # Date 1298347274 -7200 # Node ID 9664bbb9d613bbbf1c9933521d3c2132001417ae # Parent 951a4d669af029c232e41a69817ebecb6d1d697a Cleanups. diff -r 951a4d669af0 -r 9664bbb9d613 game/Engine.java --- a/game/Engine.java Tue Feb 22 05:58:55 2011 +0200 +++ b/game/Engine.java Tue Feb 22 06:01:14 2011 +0200 @@ -272,18 +272,19 @@ } else { - // Mark, if needed + // Mark the current piece as locked curr.setType(PieceType.LOCKED); - System.out.print("M1 = "+currPoint+", rotated="+curr.getRotatedPoint(currPoint)+"\n"); + + // Solve connection (with rotations) through the piece currPoint = curr.getRotatedPoint(curr.getMatchingPoint(currPoint)); + + // Mark connection as active curr.setConnectionState(currPoint, true); - System.out.print("matchingrotated="+currPoint+"\n"); - - // Move to next position - currPoint = curr.getConnection(currPoint); - System.out.print("conn="+currPoint+"\n"); - currPoint = curr.getAntiRotatedPoint(currPoint); + // Solve exit point (with rotations) + currPoint = curr.getAntiRotatedPoint(curr.getConnection(currPoint)); + + // Move to next position accordingly pieceMoveTo(currPoint); } } diff -r 951a4d669af0 -r 9664bbb9d613 game/Piece.java --- a/game/Piece.java Tue Feb 22 05:58:55 2011 +0200 +++ b/game/Piece.java Tue Feb 22 06:01:14 2011 +0200 @@ -100,7 +100,6 @@ { int point = (in + (currRotation * 2)) % 8; if (point < 0) point = 8 + point; - System.out.print("getAntiRotatedPoint("+ in +"): rot="+currRotation+", point="+point+"\n"); return point; }