Ignore:
Timestamp:
Sep 6, 2013, 8:44:14 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Message:

Move the inventory to world, to slightly reduce overall hackyness

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/protagonist.py

    r371 r374  
    7373            self._make_physics(space, position), self._make_renderer())
    7474        self.world = world
    75         self.inventory = set()
    7675        self.health_level = PROTAGONIST_HEALTH_MAX_LEVEL
    7776
     
    257256        self.form = old_protagonist.form
    258257        self.angle = old_protagonist.angle
    259         self.inventory = old_protagonist.inventory
    260258
    261259    def toggle_form(self):
     
    323321
    324322    def has_item(self, item):
    325         return item in self.inventory
     323        return item in self.world.inventory
     324
     325    def add_item(self, item):
     326        self.world.inventory.add(item)
    326327
    327328    def environmental_movement(self, dx, dy):
Note: See TracChangeset for help on using the changeset viewer.