def from_json(self, json): ''' Restore this object from the passed in json object @param json - the json object ''' CreatureSprite.from_json(self, json) self.health = json['health']
def from_json(self, json): ''' Restore this object from the passed in json object @param json - the json object ''' CreatureSprite.from_json(self, json) self.health = json['health'] self.count = json['count'] self.weapon_tier = json['wep_tier'] self.lives = json['lives'] self.bullets = json['bullets'] items = get_items() for name, num in json['inventory'].items(): for i in range(0, num): self.addItemToInventory(items[name]) for name in json['final inventory']: self.addItemToInventory(items[name])