CollectionState

class BaseClasses.CollectionState(parent: MultiWorld, allow_partial_entrances: bool = False)

Bases: object

additional_copy_functions: List[Callable[[CollectionState, CollectionState], CollectionState]] = []
additional_init_functions: List[Callable[[CollectionState, MultiWorld], None]] = []
advancements: Set[Location]
allow_partial_entrances: bool
blocked_connections: Dict[int, Set[Entrance]]
can_reach(spot: Location | Entrance | Region | str, resolution_hint: str | None = None, player: int | None = None) bool
can_reach_entrance(spot: str, player: int) bool
can_reach_location(spot: str, player: int) bool
can_reach_region(spot: str, player: int) bool
collect(item: Item, prevent_sweep: bool = False, location: Location | None = None) bool
copy() CollectionState
count(item: str, player: int) int
count_from_list(items: Iterable[str], player: int) int

Returns the cumulative count of items from a list present in state.

count_from_list_unique(items: Iterable[str], player: int) int

Returns the cumulative count of items from a list present in state. Ignores duplicates of the same item.

count_group(item_name_group: str, player: int) int

Returns the cumulative count of items from an item group present in state.

count_group_unique(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.

has(item: str, player: int, count: int = 1) bool
has_all(items: Iterable[str], player: int) bool

Returns True if each item name of items is in state at least once.

has_all_counts(item_counts: Mapping[str, int], player: int) bool

Returns True if each item name is in the state at least as many times as specified.

has_any(items: Iterable[str], player: int) bool

Returns True if at least one item name of items is in state at least once.

has_any_count(item_counts: Mapping[str, int], player: int) bool

Returns True if at least one item name is in the state at least as many times as specified.

has_from_list(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.

has_from_list_unique(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.

has_group(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.

has_group_unique(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.

locations_checked: Set[Location]
multiworld: MultiWorld
path: Dict[Region | Entrance, Tuple[str, Tuple[str, PathValue | None] | None]]
prog_items: Dict[int, Counter[str]]
reachable_regions: Dict[int, Set[Region]]
remove(item: Item)
stale: Dict[int, bool]
sweep_for_advancements(locations: Iterable[Location] | None = None) None
sweep_for_events(locations: Iterable[Location] | None = None) None
update_reachable_regions(player: int)