Added new ComponentEvents system in IEventBus. (#1601)

* Added new ComponentEventBus, combined it with IEventBus.

* Removed all traces of IEntity from ComponentDependencies.
Removed IEntityManager dependency from ComponentManager.

* Added entity create/delete events to IEntityManager.

* ComponentEvents now use EntitySystemMessages instead of their custom ComponentEvent class.

* Component events are now just overloads of entity events.

* Removed obsolete EntitySystemMessage, now everything uses the base EntityEventArgs.

* Add a bool argument for if the message should be broadcast as well as directed.
Fix ordering and init issues of events in EntityManager.

* Changed names from Component/Entity events to Directed/Broadcast.

* Fix bugs and unit tests.
This commit is contained in:
Acruid
2021-03-09 11:02:24 -08:00
committed by GitHub
parent 31f921e4aa
commit f7e8178736
61 changed files with 716 additions and 258 deletions

View File

@@ -244,7 +244,7 @@ namespace Robust.Shared.Prototypes
var component = (Component) factory.GetComponent(name);
CurrentDeserializingComponent = name;
component.Owner = entity;
componentDependencyManager.OnComponentAdd(entity, component);
componentDependencyManager.OnComponentAdd(entity.Uid, component);
entity.AddComponent(component);
}