- def update_position(self, position_string):
- """Update self.position, ensure it's within map bounds."""
-
- def get_axis_position_from_argument(axis, token):
- if len(token) < 3 or token[:2] != axis + ':' or \
- not token[2:].isdigit():
- raise ArgumentError('Bad arg for ' + axis + ' position.')
- return int(token[2:])
-
- new_position = self.get_yx(position_string)
- if new_position[0] >= self.map_size[0] or \
- new_position[1] >= self.map_size[1]:
+ def update_things(self, thing_description):
+ """Append thing of thing_description to self.things."""
+ thing_types = {'human': '@', 'monster': 'M'}
+ tokens = thing_description.split()
+ if len(tokens) != 2:
+ raise ArgumentError('Wrong number of tokens.')
+ yx = self.get_yx(tokens[1])
+ if yx[0] >= self.map_size[0] or yx[1] >= self.map_size[1]: