private static boolean assertLegal(Grid g, Shape s, Point pos, Shape overShape, Point overPos) {
		if (g == null) { return false; }
		
		Point[] points = overShape.getCoords();
		boolean isOverlap = false;
		
		coords = s.getCoords();
		for (Point p : coords) {
			if (overPos != null) {
				isOverlap = false;
				for (Point p2 : points) {
					if (p2.x + overPos.x == p.x + pos.x && p2.y + overPos.y == p.y + pos.y) {
						isOverlap = true;
						break;
					}
				}
			}
			
			if (!isOverlap) {
				cell = g.cell(pos.y + p.y, pos.x + p.x);
				if (cell == null || cell.getState() == Grid.GridState.BLOCK) {
					return false;
				}
			}
		}
		return true;
	}