CompFactory updates (#37559)

This commit is contained in:
metalgearsloth
2025-05-20 15:08:55 +10:00
committed by GitHub
parent bc0139f961
commit 0d4f9640b5
38 changed files with 70 additions and 102 deletions

View File

@@ -96,7 +96,7 @@ public sealed partial class GunSystem
if (component is ProjectileBatteryAmmoProviderComponent battery)
{
if (ProtoManager.Index<EntityPrototype>(battery.Prototype).Components
.TryGetValue(_factory.GetComponentName(typeof(ProjectileComponent)), out var projectile))
.TryGetValue(Factory.GetComponentName<ProjectileComponent>(), out var projectile))
{
var p = (ProjectileComponent) projectile.Component;

View File

@@ -33,7 +33,7 @@ public sealed partial class GunSystem
return null;
if (entityProto.Components
.TryGetValue(_factory.GetComponentName(typeof(ProjectileComponent)), out var projectile))
.TryGetValue(Factory.GetComponentName<ProjectileComponent>(), out var projectile))
{
var p = (ProjectileComponent) projectile.Component;

View File

@@ -28,14 +28,11 @@ namespace Content.Server.Weapons.Ranged.Systems;
public sealed partial class GunSystem : SharedGunSystem
{
[Dependency] private readonly IComponentFactory _factory = default!;
[Dependency] private readonly BatterySystem _battery = default!;
[Dependency] private readonly DamageExamineSystem _damageExamine = default!;
[Dependency] private readonly PricingSystem _pricing = default!;
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly SharedStaminaSystem _stamina = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly PowerCellSystem _powerCell = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
private const float DamagePitchVariation = 0.05f;