Skip to content

Commit

Permalink
Docs: has_all and has_any (ArchipelagoMW#1725)
Browse files Browse the repository at this point in the history

Co-authored-by: el-u <[email protected]>
  • Loading branch information
Berserker66 and el-u authored Apr 16, 2023
1 parent ea03c90 commit f395a6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,11 @@ def has(self, item: str, player: int, count: int = 1) -> bool:
return self.prog_items[item, player] >= count

def has_all(self, items: Set[str], player: int) -> bool:
"""Returns True if each item name of items is in state at least once."""
return all(self.prog_items[item, player] for item in items)

def has_any(self, items: Set[str], player: int) -> bool:
"""Returns True if at least one item name of items is in state at least once."""
return any(self.prog_items[item, player] for item in items)

def count(self, item: str, player: int) -> int:
Expand Down

0 comments on commit f395a6d

Please sign in to comment.