Inline GetComponent

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:55:25 +01:00
parent c2e6da1e54
commit b835bea086
131 changed files with 363 additions and 299 deletions

View File

@@ -121,7 +121,7 @@ namespace Content.Server.StationEvents.Events
physics.Mass * ((MaxAngularVelocity - MinAngularVelocity) * _robustRandom.NextFloat() +
MinAngularVelocity));
// TODO: God this disgusts me but projectile needs a refactor.
meteor.GetComponent<ProjectileComponent>().TimeLeft = 120f;
IoCManager.Resolve<IEntityManager>().GetComponent<ProjectileComponent>(meteor.Uid).TimeLeft = 120f;
}
}
}

View File

@@ -88,7 +88,7 @@ namespace Content.Server.StationEvents.Events
return;
var pulse = _entityManager.SpawnEntity("RadiationPulse", coordinates);
pulse.GetComponent<RadiationPulseComponent>().DoPulse();
IoCManager.Resolve<IEntityManager>().GetComponent<RadiationPulseComponent>(pulse.Uid).DoPulse();
ResetTimeUntilPulse();
}
@@ -96,7 +96,7 @@ namespace Content.Server.StationEvents.Events
{
var pulse = IoCManager.Resolve<IEntityManager>()
.SpawnEntity("RadiationPulse", at);
pulse.GetComponent<RadiationPulseComponent>().DoPulse();
IoCManager.Resolve<IEntityManager>().GetComponent<RadiationPulseComponent>(pulse.Uid).DoPulse();
}
private bool TryFindRandomGrid(IMapGrid mapGrid, out EntityCoordinates coordinates)