From d6d3ba3b0812a10a4255c463b8f20b40983fb582 Mon Sep 17 00:00:00 2001 From: onee-only Date: Tue, 26 Nov 2024 05:49:26 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=EC=84=B9=EC=85=98=20=EC=9E=AC=EC=82=AC?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- board/internal/board.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/internal/board.py b/board/internal/board.py index 283d6b4..340ffbe 100644 --- a/board/internal/board.py +++ b/board/internal/board.py @@ -33,7 +33,8 @@ def fetch(start: Point, end: Point): fetched = None for sec_y in range(start.y // Section.LENGTH, end.y // Section.LENGTH - 1, - 1): for sec_x in range(start.x // Section.LENGTH, end.x // Section.LENGTH + 1): - section = Board.sections[sec_y][sec_x] + # TODO: 임시로 기존 맵 돌려쓰도록 만듦. **나중에 삭제** + section = Board.sections[sec_y % -len(Board.sections)][sec_x % -len(Board.sections)] start_p = Point( x=max(start.x, section.abs_x) - (section.abs_x), From 6ad94999958a98130f56cd3f9fb49e3fbd476c76 Mon Sep 17 00:00:00 2001 From: byundojin Date: Tue, 26 Nov 2024 06:09:57 +0000 Subject: [PATCH 2/2] =?UTF-8?q?section=20=EC=9E=AC=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=8B=9C=20section=20=EC=A2=8C=ED=91=9C=20=EA=B3=84=EC=82=B0?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- board/internal/board.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/board/internal/board.py b/board/internal/board.py index 340ffbe..339c8dd 100644 --- a/board/internal/board.py +++ b/board/internal/board.py @@ -36,13 +36,16 @@ def fetch(start: Point, end: Point): # TODO: 임시로 기존 맵 돌려쓰도록 만듦. **나중에 삭제** section = Board.sections[sec_y % -len(Board.sections)][sec_x % -len(Board.sections)] + abs_sec_x = sec_x * Section.LENGTH + abs_sec_y = sec_y * Section.LENGTH + start_p = Point( - x=max(start.x, section.abs_x) - (section.abs_x), - y=min(start.y, section.abs_y + Section.LENGTH-1) - section.abs_y + x=max(start.x, abs_sec_x) - (abs_sec_x), + y=min(start.y, abs_sec_y + Section.LENGTH-1) - abs_sec_y ) end_p = Point( - x=min(end.x, section.abs_x + Section.LENGTH-1) - section.abs_x, - y=max(end.y, section.abs_y) - section.abs_y + x=min(end.x, abs_sec_x + Section.LENGTH-1) - abs_sec_x, + y=max(end.y, abs_sec_y) - abs_sec_y ) fetched = section.fetch(start=start_p, end=end_p)