Core: Add Item.excludable helper function (#4080)

Some worlds might want to check for "Item is junk", i.e. an excludable item.

Because this is both `filler` and `trap`, and because `filler` is `0`, there are many "wrong ways" to do this. So I think we should provide a helper function for it.
This commit is contained in:
NewSoupVi 2024-11-07 09:59:08 +01:00 committed by GitHub
parent 345d5154a9
commit a29205b547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -1264,6 +1264,10 @@ class Item:
def trap(self) -> bool:
return ItemClassification.trap in self.classification
@property
def excludable(self) -> bool:
return not (self.advancement or self.useful)
@property
def flags(self) -> int:
return self.classification.as_flag()