| 14 | |
| 15 | class Depot(): |
| 16 | def __init__(self, top_left: Point, entities: List[str]): |
| 17 | self.root = top_left |
| 18 | self.resource_roots: Dict[str, Point] = {} |
| 19 | self.resource_count: Dict[str, int] = {} |
| 20 | # keep track of how many "chunks" |
| 21 | self.height = 6 |
| 22 | for idx, entity in enumerate(entities): |
| 23 | self.resource_roots[entity] = self.root + Point(2 * idx, 0) |
| 24 | self.resource_count[entity] = 0 |
| 25 | width = len(self.resource_roots) * 3 |
| 26 | height = 6 |
| 27 | self.area = Rect(self.root, self.root + Point(width, height)) |
| 28 | |
| 29 | def address(self, entity: str, n: int) -> Point: |
| 30 | root = self.resource_roots[entity] |