- def new_from_shape(self, init_char):
- import copy
- new_map = copy.deepcopy(self)
- for pos in new_map:
- new_map[pos] = init_char
- return new_map
+ def pos_in_projection(self, pos, offset, maps_size):
+ pos_y = pos[1].y + (maps_size.y * pos[0].y) - offset.y
+ pos_x = pos[1].x + (maps_size.x * pos[0].x) - offset.x
+ return YX(pos_y, pos_x)
+
+ def absolutize_coordinate(self, map_size, big_yx, little_yx):
+
+ def adapt_axis(axis):
+ maps_crossed = little_yx[axis] // map_size[axis]
+ new_big = big_yx[axis] + maps_crossed
+ new_little = little_yx[axis] % map_size[axis]
+ return new_big, new_little