How to use the osrsbox.items_api.item_properties.ItemProperties 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 / builders / items / build_item.py View on Github external
def check_duplicate_item(self) -> ItemProperties:
        """Determine if this is a duplicate item.

        :return: An ItemProperties object.
        """
        # Start by setting the duplicate property to False
        self.item_dict["duplicate"] = False
        # Create an ItemProperties object
        item_properties = ItemProperties(**self.item_dict)

        # Check list of known bad duplicates
        if str(item_properties.id) in self.duplicate_items:
            duplicate_status = self.duplicate_items[str(item_properties.id)]["duplicate"]
            self.item_dict["duplicate"] = duplicate_status
            return None

        # Check noted, placeholder and noted properties
        # If any of these properties, it must be a duplicate
        if item_properties.stacked or item_properties.noted or item_properties.placeholder:
            self.item_dict["duplicate"] = True
            return None

        # Set the item properties that we want to compare
        correlation_properties = {
            "name": False,
github osrsbox / osrsbox-db / osrsbox / items_api / all_items.py View on Github external
def __init__(self, input_data_file_or_directory: Path = PATH_TO_ITEMS_COMPLETE_JSON):
        self.all_items: List[ItemProperties] = list()
        self.all_items_dict: Dict[int, ItemProperties] = dict()
        self.load_all_items(input_data_file_or_directory)
github osrsbox / osrsbox-db / osrsbox / items_api / all_items.py View on Github external
def __init__(self, input_data_file_or_directory: Path = PATH_TO_ITEMS_COMPLETE_JSON):
        self.all_items: List[ItemProperties] = list()
        self.all_items_dict: Dict[int, ItemProperties] = dict()
        self.load_all_items(input_data_file_or_directory)
github osrsbox / osrsbox-db / builders / items / build_item.py View on Github external
def generate_item_object(self):
        """Generate the `ItemProperties` object from the item_dict dictionary."""
        self.item_properties = ItemProperties(**self.item_dict)