Inline EntityManager

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:11:52 +01:00
parent bd18574412
commit 5e177ae734
108 changed files with 250 additions and 199 deletions

View File

@@ -76,7 +76,7 @@ namespace Content.Client.IconSmoothing
// ensures lastposition initial value is populated on spawn. Just calling
// the hook here would cause a dirty event to fire needlessly
UpdateLastPosition();
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, null, Mode));
IoCManager.Resolve<IEntityManager>().EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, null, Mode));
}
if (Sprite != null && Mode == IconSmoothingMode.Corners)
@@ -260,7 +260,7 @@ namespace Content.Client.IconSmoothing
if (Owner.Transform.Anchored)
{
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, Mode));
IoCManager.Resolve<IEntityManager>().EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, Mode));
}
}
@@ -268,7 +268,7 @@ namespace Content.Client.IconSmoothing
{
if (Owner.Transform.Anchored)
{
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, Mode));
IoCManager.Resolve<IEntityManager>().EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, Mode));
UpdateLastPosition();
}
}
@@ -278,7 +278,7 @@ namespace Content.Client.IconSmoothing
{
foreach (var entity in candidates)
{
if (!Owner.EntityManager.TryGetComponent(entity, out IconSmoothComponent? other))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out IconSmoothComponent? other))
{
continue;
}