Commits

Andrew Nguyen  committed 2bfa3ec

reverted back from my do of correcting player 2 clickable pits

  • Participants
  • Parent commits 1b4b882

Comments (0)

Files changed (4)

File src/ClassicLayout.java

 		int ringCenterY = yorigin + boxheight / 2;
 		int stoneCenterX = (int)(ringCenterX + stoneR * Math.cos(a));
 		int stoneCenterY = (int)(ringCenterY + stoneR * Math.sin(a));
-		System.out.println("DEBUG: R: " + stoneR + " stoneX: " + stoneCenterX +
-				" stoneY: " + stoneCenterY + " a: " + a);
+		//System.out.println("DEBUG: R: " + stoneR + " stoneX: " + stoneCenterX +
+		//		" stoneY: " + stoneCenterY + " a: " + a);
 		return new Ellipse2D.Double(stoneCenterX - stoneR * Math.sqrt(2),
 				stoneCenterY - stoneR * Math.sqrt(2), stoneR * 2, stoneR * 2);
 	}

File src/GeomLayout.java

 		for (int c = 0; c < boardLength; c++)
 			pitRects[1][c] = new Rectangle2D.Double(width / 8 * (c + 1),
 					0, width / 8, height / 2);
-		int s = boardLength - 1; /* Hack var to reverse direction */
 		for (int c = 0; c < boardLength; c++)
 		{	
 			pitRects[0][c] = new Rectangle2D.Double(width / 8 * (c + 1),
 					height / 2, width / 8, height / 2);
-			--s;
 		}
 	}
 

File src/MancalaGUI.java

 	{
 		if (game.isGameOver())
 			return;
-		Rectangle2D.Double[][] rects = board.getPitRectangles().clone();
-		
-		//reverse player 2 pits
-		Rectangle2D.Double[] temp = new Rectangle2D.Double[rects[1].length];
-		for (int i = 0; i<Mancala.BOARD_LENGTH; i++)
-			temp[Mancala.BOARD_LENGTH-1-i] = rects[1][i];
-		rects[1] = temp;
+		Rectangle2D.Double[][] rects = board.getPitRectangles();
 
 		for (int row = 0; row < Mancala.N_PLAYERS; row++)
 		{

File src/MancalaTester.java

 	public static void main(String[] args)
 	{
 
-		BoardLayout[] layouts = { new GeomLayout(Mancala.N_PLAYERS,
-				Mancala.BOARD_LENGTH), new ClassicLayout(Mancala.N_PLAYERS, Mancala.BOARD_LENGTH) };
+		BoardLayout[] layouts = { new ClassicLayout(Mancala.N_PLAYERS,
+				Mancala.BOARD_LENGTH), new GeomLayout(Mancala.N_PLAYERS, Mancala.BOARD_LENGTH) };
 		MancalaGUI gui = new MancalaGUI(layouts);
 	}
 }