Public Piece Tests with inverted Point Coordinates

Hello,

It might just be a misconception on my part, but why does e.g. TestLPiece() except the rotation point’s coordinates to be (1,0)? As far as I can see from the visualization in 1b, it should be (0,1), right?
WhatsApp Image 2022-06-22 at 5.42.42 PM
WhatsApp Image 2022-06-22 at 5.43.13 PM

The row goes first, then the column. The test is correct.

1 Like

So X should be the vertical direction and Y the horizontal direction?

1 Like

There is a typo in the argument names of checkPiece:

	private void checkPiece(Piece piece, int width, int height, int rotationX, int rotationY) throws Exception {
		assertEquals("Width of piece is wrong", width, piece.getWidth());
		assertEquals("Height of piece is wrong", height, piece.getHeight());
		assertEquals("X coordinate of rotation point is wrong", rotationX, piece.getRotationPoint().getRow());
		assertEquals("Y coordinate of rotation point is wrong", rotationY, piece.getRotationPoint().getColumn());
	}

rotationX is compared with the row. One would rather expect the argument to be named rotationRow.

Or one could view our coordinate system to be rotated by 90 degrees / transposed if that is less confusing.