@Override
	public boolean equals(Object obj) {
		// standard equals() technique 1
		if (obj == this) return true;
		
		// standard equals() technique 2
		// (null will be false)
		// any other class object will be caught as false
		if (!(obj instanceof Piece)) return false;
		Piece other = (Piece)obj;
		
		
		// above lines guarantee that the object is a Piece
		// look inside the other piece and determine whether
		// the properties are the same
		TPoint[] objBody = other.getBody();
		TPoint[] ourBody = body;
		
		// check for same size (so other piece can't contain more points)
		if (objBody.length != ourBody.length) return false;
		
		boolean[] matchingCoords = new boolean[ourBody.length];
		for (int i = 0; i < ourBody.length; i++) {
			int ourX = ourBody[i].x;
			int ourY = ourBody[i].y;
			for (int j = 0; j < objBody.length; j++){
				int objX = objBody[j].x;
				int objY = objBody[j].y;
				
				if (ourX == objX && ourY == objY) {
					matchingCoords[i] = true;
				}
			}
		}
		
		// check that all coordinates matched
		// credit to stackOverflow for this alternative to normal
		// for loop checking each element: Question 18631837
		for (boolean match : matchingCoords){
			if (!match) return false;
		}
		
		return true;
	}