(self, (x0,y0,x1,y1))
| 254 | |
| 255 | # find(): finds objects that are in a certain area. |
| 256 | def find(self, (x0,y0,x1,y1)): |
| 257 | done = set() |
| 258 | for k in self._getrange((x0,y0,x1,y1)): |
| 259 | if k not in self._grid: continue |
| 260 | for obj in self._grid[k]: |
| 261 | if obj in done: continue |
| 262 | done.add(obj) |
| 263 | if (obj.x1 <= x0 or x1 <= obj.x0 or |
| 264 | obj.y1 <= y0 or y1 <= obj.y0): continue |
| 265 | yield obj |
| 266 | return |
| 267 | |
| 268 | |
| 269 | # create_bmp |