MCPcopy Create free account
hub / github.com/JoshuaPostel/texaform / clear_column

Function clear_column

python/gather.py:83–106  ·  view source on GitHub ↗
(dog: Dog, top: Point, height: int, depot: Optional[Depot])

Source from the content-addressed store, hash-verified

81 self.store(dog, entity)
82
83def clear_column(dog: Dog, top: Point, height: int, depot: Optional[Depot]):
84 start = top + Point(0, -1)
85 success = dog.goto(start)
86 if not success:
87 dog.approach(start)
88 (char, _, _) = dog.scan()
89 dog.send(f"PICK {char}")
90 if depot:
91 depot.store(dog, char_name_map[char])
92 else:
93 dog.drop_within(TRASH_ZONE)
94 return clear_column(dog, top, height, depot)
95 dog.face("S")
96 while dog.location != Point(top.x, top.y + height):
97 (char, _, _) = dog.scan()
98 if char == ".":
99 dog.move()
100 else:
101 dog.pick(char)
102 if depot:
103 depot.store(dog, char_name_map[char])
104 else:
105 dog.drop_within(TRASH_ZONE)
106 clear_column(dog, top, height, depot)
107
108def clear_area(dog: Dog, area: Rect, depot: Optional[Depot]):
109 for x in range(area.width() + 1):

Callers 1

clear_areaFunction · 0.85

Calls 10

PointClass · 0.90
approachMethod · 0.80
scanMethod · 0.80
storeMethod · 0.80
drop_withinMethod · 0.80
faceMethod · 0.80
moveMethod · 0.80
gotoMethod · 0.45
sendMethod · 0.45
pickMethod · 0.45

Tested by

no test coverage detected