mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Core: Rename "count_exclusive" methods to "count_unique" (#3386)
* rename exclusive to unique * lint * group as well
This commit is contained in:
@@ -728,7 +728,7 @@ class CollectionState():
|
||||
return True
|
||||
return False
|
||||
|
||||
def has_from_list_exclusive(self, items: Iterable[str], player: int, count: int) -> bool:
|
||||
def has_from_list_unique(self, items: Iterable[str], player: int, count: int) -> bool:
|
||||
"""Returns True if the state contains at least `count` items matching any of the item names from a list.
|
||||
Ignores duplicates of the same item."""
|
||||
found: int = 0
|
||||
@@ -743,7 +743,7 @@ class CollectionState():
|
||||
"""Returns the cumulative count of items from a list present in state."""
|
||||
return sum(self.prog_items[player][item_name] for item_name in items)
|
||||
|
||||
def count_from_list_exclusive(self, items: Iterable[str], player: int) -> int:
|
||||
def count_from_list_unique(self, items: Iterable[str], player: int) -> int:
|
||||
"""Returns the cumulative count of items from a list present in state. Ignores duplicates of the same item."""
|
||||
return sum(self.prog_items[player][item_name] > 0 for item_name in items)
|
||||
|
||||
@@ -758,7 +758,7 @@ class CollectionState():
|
||||
return True
|
||||
return False
|
||||
|
||||
def has_group_exclusive(self, item_name_group: str, player: int, count: int = 1) -> bool:
|
||||
def has_group_unique(self, item_name_group: str, player: int, count: int = 1) -> bool:
|
||||
"""Returns True if the state contains at least `count` items present in a specified item group.
|
||||
Ignores duplicates of the same item.
|
||||
"""
|
||||
@@ -778,7 +778,7 @@ class CollectionState():
|
||||
for item_name in self.multiworld.worlds[player].item_name_groups[item_name_group]
|
||||
)
|
||||
|
||||
def count_group_exclusive(self, item_name_group: str, player: int) -> int:
|
||||
def count_group_unique(self, item_name_group: str, player: int) -> int:
|
||||
"""Returns the cumulative count of items from an item group present in state.
|
||||
Ignores duplicates of the same item."""
|
||||
player_prog_items = self.prog_items[player]
|
||||
|
Reference in New Issue
Block a user