mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 20:47:17 +02:00
Remove cmd_set from component
This commit is contained in:
parent
1bfb3643ad
commit
8bda7c10f7
2 changed files with 1 additions and 15 deletions
|
|
@ -50,8 +50,6 @@ class Component(metaclass=BaseComponent):
|
|||
name = ""
|
||||
slot = None
|
||||
|
||||
cmd_set: CmdSet = None
|
||||
|
||||
_fields = {}
|
||||
|
||||
def __init__(self, host=None):
|
||||
|
|
@ -115,11 +113,7 @@ class Component(metaclass=BaseComponent):
|
|||
Component: The loaded instance of the component
|
||||
|
||||
"""
|
||||
inst = cls(host)
|
||||
if inst.cmd_set:
|
||||
host.cmdset.add(inst.cmd_set)
|
||||
|
||||
return inst
|
||||
return cls(host)
|
||||
|
||||
def at_added(self, host):
|
||||
"""
|
||||
|
|
@ -132,9 +126,6 @@ class Component(metaclass=BaseComponent):
|
|||
if self.host and self.host != host:
|
||||
raise exceptions.InvalidComponentError("Components must not register twice!")
|
||||
|
||||
if self.cmd_set:
|
||||
self.host.cmdset.add(self.cmd_set)
|
||||
|
||||
self.host = host
|
||||
|
||||
def at_removed(self, host):
|
||||
|
|
@ -148,9 +139,6 @@ class Component(metaclass=BaseComponent):
|
|||
if host != self.host:
|
||||
raise ValueError("Component attempted to remove from the wrong host.")
|
||||
|
||||
if self.cmd_set:
|
||||
self.host.cmdset.remove(self.cmd_set)
|
||||
|
||||
self.host = None
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -118,8 +118,6 @@ class ComponentHandler:
|
|||
field.at_removed(component)
|
||||
|
||||
component.at_removed(self.host)
|
||||
if component.cmd_set:
|
||||
self.host.cmdset.remove(component.cmd_set)
|
||||
|
||||
self.host.tags.remove(component.name, category="components")
|
||||
self.host.signals.remove_object_listeners_and_responders(component)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue