+ def __getitem__(self, yx):
+ return self.terrain[self.get_pos_i(yx)]
+
+ def __setitem__(self, yx, c):
+ pos_i = self.get_pos_i(yx)
+ self.terrain = self.terrain[:pos_i] + c + self.terrain[pos_i + 1:]
+
+ def __iter__(self):
+ for y in range(self.size[0]):
+ for x in range(self.size[1]):
+ yield [y, x]
+