Skip to content

Commit

Permalink
process new remove* tag variations
Browse files Browse the repository at this point in the history
  • Loading branch information
egocarib committed Jun 24, 2024
1 parent e473182 commit 419a6ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hagadias/qudobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ def resolve_inheritance(self) -> None:
inherited = self.parent.all_attributes
all_attributes = deepcopy(self.attributes)
removes_parts = "removepart" in all_attributes
removes_builders = "removebuilder" in all_attributes
removes_invobj = "removeinventoryobject" in all_attributes
for tag in inherited:
if tag not in all_attributes:
all_attributes[tag] = {}
Expand All @@ -243,6 +245,14 @@ def resolve_inheritance(self) -> None:
if name in all_attributes["removepart"]:
# remove `name` part from `self.name` due to `removepart` tag
continue # don't inherit part if it's explicitly removed from the child
elif tag == "builder" and removes_builders:
if name in all_attributes["removebuilder"]:
# remove `name` builder due to `removebuilder` tag
continue
elif tag == "inventoryobject" and removes_invobj:
if name in all_attributes["removeinventoryobject"]:
# remove `name` inventoryobject due to `removeinventoryobject` tag
continue
all_attributes[tag][name] = {}
elif (
tag == "tag"
Expand Down

0 comments on commit 419a6ce

Please sign in to comment.