How to use the osrsbox.monsters_api.monster_drop.MonsterDrop function in osrsbox

To help you get started, we’ve selected a few osrsbox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github osrsbox / osrsbox-db / osrsbox / monsters_api / monster_properties.py View on Github external
def from_json(cls, json_dict: Dict) -> List[MonsterDrop]:
        """Convert the dict under the 'drops' key into actual :class:`MonsterDrop`"""
        monster_drops = list()
        if json_dict.get("drops"):
            for drop in json_dict["drops"]:
                monster_drops.append(MonsterDrop(**drop))

        json_dict["drops"] = monster_drops

        return cls(**json_dict)