forked from ArchipelagoMW/Archipelago
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from Ziktofel/item_processing_stability
Item processing stability
- Loading branch information
Showing
23 changed files
with
494 additions
and
407 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import enum | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
from BaseClasses import Item, ItemClassification | ||
from worlds.sc2.item.item_tables import ItemData | ||
|
||
|
||
class ItemFilterFlags(enum.IntFlag): | ||
Available = 0 | ||
Locked = enum.auto() | ||
StartInventory = enum.auto() | ||
NonLocal = enum.auto() | ||
Removed = enum.auto() | ||
Plando = enum.auto() | ||
Excluded = enum.auto() | ||
AllowedOrphan = enum.auto() | ||
"""Used to flag items that shouldn't be filtered out with their parents""" | ||
ForceProgression = enum.auto() | ||
"""Used to flag items that aren't classified as progression by default""" | ||
Necessary = enum.auto() | ||
"""Used to flag items that are never allowed to be culled. | ||
This differs from `Locked` in that locked items may still be culled if there's space issues or in some circumstances when a parent item is culled.""" | ||
|
||
Unremovable = Locked|StartInventory|Plando|Necessary | ||
|
||
|
||
@dataclass | ||
class FilterItem: | ||
name: str | ||
data: ItemData | ||
index: int = 0 | ||
flags: ItemFilterFlags = ItemFilterFlags.Available | ||
|
||
|
||
class StarcraftItem(Item): | ||
game: str = "Starcraft 2" | ||
filter_flags: ItemFilterFlags = ItemFilterFlags.Available | ||
|
||
def __init__(self, name: str, classification: ItemClassification, code: Optional[int], player: int, filter_flags: ItemFilterFlags = ItemFilterFlags.Available): | ||
super().__init__(name, classification, code, player) | ||
self.filter_flags = filter_flags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.