diff --git a/satisfactory/__init__.py b/satisfactory/__init__.py index 0b5dda9..d7aa1cd 100644 --- a/satisfactory/__init__.py +++ b/satisfactory/__init__.py @@ -21,19 +21,40 @@ class Cookbook(object): return self.__recipes[item] def all(self) -> Iterable[str]: + """ + :return: An iterable of all available recipe names + """ return self.__recipes.keys() - def recipes(self, name: str) -> Dict: + def recipes(self, name: str) -> Iterable[Dict]: + """ + :param name: The target item name + :return: A sequence of possible recipes for the target item + """ return self.__recipes[name]['recipes'] def is_component(self, name: str) -> bool: + """ + :param name: The name of an item + :return: Whether the item is a component; ie, craftable. + """ return 'component' in self.__recipes[name]['type'] def components(self) -> Generator[str, None, None]: + """ + :return: The names of all items that are resources. + """ return (i for i in self.all() if self.is_component(i)) def is_resource(self, name: str) -> bool: + """ + :param name: The name of an item + :return: Whether the item must have harvested (rather than crafted) + """ return 'resource' in self.__recipes[name]['type'] def resources(self) -> Generator[str, None, None]: + """ + :return: The names of all items that are resources. + """ return (i for i in self.all() if self.is_resource(i))