mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 00:06:30 +01:00
Include parents
This commit is contained in:
parent
bda6bbe80b
commit
8ded9e7914
1 changed files with 9 additions and 1 deletions
|
|
@ -21,7 +21,15 @@ class BaseComponent(type):
|
|||
as a component in the Component Listing using its name.
|
||||
All of them require a unique name.
|
||||
"""
|
||||
attrs['_fields'] = {}
|
||||
attrs_name = attrs.get('name')
|
||||
if attrs_name and not COMPONENT_LISTING.get(attrs_name):
|
||||
new_fields = {}
|
||||
attrs['_fields'] = new_fields
|
||||
for parent in parents:
|
||||
_parent_fields = getattr(parent, "_fields")
|
||||
if _parent_fields:
|
||||
new_fields.update(_parent_fields)
|
||||
|
||||
new_type = super().__new__(cls, name, parents, attrs)
|
||||
if new_type.__base__ == object:
|
||||
return new_type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue