(self, x, y, lim)
| 30 | self.buf = [] |
| 31 | |
| 32 | def snap(self, x, y, lim): |
| 33 | cur, cid, minl = None, None, 1000 |
| 34 | for pg in self.body: |
| 35 | for i in pg: |
| 36 | d = (i[0]-x)**2+(i[1]-y)**2 |
| 37 | if d < minl:cur,cid,minl = pg,i,d |
| 38 | if minl**0.5>lim:return None |
| 39 | return cur, cur.index(cid) |
| 40 | |
| 41 | def pick(self, x, y, lim): |
| 42 | rst = self.snap(x, y, lim) |
no outgoing calls
no test coverage detected