-class Task:
-
- def __init__(self, thing, name, args=()):
- self.name = name
- self.thing = thing
- self.args = args
- self.todo = 3
-
- def check(self):
- if self.name == 'MOVE':
- test_pos = self.thing.world.map_.move(self.thing.position, self.args[0])
- if self.thing.world.map_[test_pos] != '.':
- raise GameError(str(self.thing.id_) +
- ' would move into illegal terrain')
- for t in self.thing.world.things:
- if t.position == test_pos:
- raise GameError(str(self.thing.id_) +
- ' would move into other thing')