From e5b6011d412a91880626a44fb9f586647bf12147 Mon Sep 17 00:00:00 2001 From: Guanforever <2307786059@qq.com> Date: Mon, 30 Jun 2025 18:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E4=BF=9Dboss=E5=92=8Clock=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E5=9C=A8=E8=B7=AF=E5=BE=84=E4=B8=8A=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SourceCollector.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/SourceCollector.py b/SourceCollector.py index a283f62..723ca6e 100644 --- a/SourceCollector.py +++ b/SourceCollector.py @@ -19,15 +19,21 @@ class SourceCollector: self.end_pos = None self.path = [] self.node_path = [] + self.boss_pos = None + self.lock_pos = None if self.filename: self.maze = [] with open(f"{self.filename}",'r') as f: reader = csv.reader(f) - for row in reader: + for idx,row in enumerate(reader): t = [] - for i in row: - if i.startswith('b') or i.startswith('l'): + for idy,i in enumerate(row): + if i.startswith('b'): t.append('0') + self.boss_pos = (idx,idy) + elif i.startswith('l'): + t.append('0') + self.lock_pos = (idx,idy) else: t.append(i) self.maze.append(t) @@ -142,8 +148,8 @@ class SourceCollector: children = sn.children[:] for child in children: self.dfs(child) - - children.sort(key=lambda c: len(c.path)) + if self.colNums < 11: + children.sort(key=lambda c: len(c.path)) cur = None for idx, child in enumerate(children): if child.dp > 0: @@ -203,11 +209,8 @@ class SourceCollector: if idx > 0: if item == self.path[idx-1]: del self.path[idx] - - if self.path and self.end_pos and self.path[-1] != self.end_pos: - bfs_tail = self.bfs_path(self.path[-1], self.end_pos) - if bfs_tail: - self.path.extend(bfs_tail[1:]) + +