chore: sync

This commit is contained in:
2025-12-11 15:58:26 +01:00
parent 7076b2d40c
commit e10ed8df26

View File

@@ -91,12 +91,15 @@ function is_area_red_green(
const bl_corner: Coordinate = { x: min_x, y: max_y }; const bl_corner: Coordinate = { x: min_x, y: max_y };
const br_corner: Coordinate = { x: max_x, y: max_y }; const br_corner: Coordinate = { x: max_x, y: max_y };
// Find valid closers // NOTE: need to check exact pairs, so they create a line somehow
// Every corner needs to be surrounded // - Every corner is surrounded
// - Every surround must form a line
// NOTE: I don't think this will be enough // old: Every corner needs to be surrounded
// Maybe not cover corners and cover verticals // Error 1: 4560365591
// l // Verify left wall
// floor.red_tiles.some((tile) => {
// // point and side or point and point and the inverse
// });
const l_cover = const l_cover =
floor.red_tiles.some((tile) => floor.red_tiles.some((tile) =>
tile.x <= tl_corner.x && tile.y <= tl_corner.y tile.x <= tl_corner.x && tile.y <= tl_corner.y
@@ -120,9 +123,9 @@ function is_area_red_green(
// t // t
const t_cover = const t_cover =
floor.red_tiles.some((tile) => floor.red_tiles.some((tile) =>
tile.x <= tr_corner.x && tile.y <= tr_corner.y tile.x >= tr_corner.x && tile.y <= tr_corner.y
) && floor.red_tiles.some((tile) => ) && floor.red_tiles.some((tile) =>
tile.x >= tl_corner.x && tile.y <= tl_corner.y tile.x <= tl_corner.x && tile.y <= tl_corner.y
); );
return l_cover && r_cover && b_cover && t_cover; return l_cover && r_cover && b_cover && t_cover;