Inline OwnerUid

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 16:30:34 +01:00
parent 2eacf98335
commit f386b57148
85 changed files with 219 additions and 215 deletions

View File

@@ -110,9 +110,9 @@ namespace Content.Server.Access.Components
private void HandleIdButton(IEntity user, ItemSlot slot)
{
if (slot.HasItem)
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(OwnerUid, slot, user);
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, slot, user);
else
EntitySystem.Get<ItemSlotsSystem>().TryInsertFromHand(OwnerUid, slot, user);
EntitySystem.Get<ItemSlotsSystem>().TryInsertFromHand(((IComponent) this).Owner, slot, user);
}
public void UpdateUserInterface()

View File

@@ -59,7 +59,7 @@ public partial class AdminLogSystem
EntityUid id => id,
IEntity entity => entity,
IPlayerSession {AttachedEntityUid: { }} session => session.AttachedEntityUid.Value,
IComponent component => component.OwnerUid,
IComponent component => component.Owner,
_ => null
};

View File

@@ -51,11 +51,11 @@ namespace Content.Server.Animals.Systems
continue;
}
if (!_solutionContainerSystem.TryGetSolution(udder.OwnerUid, udder.TargetSolutionName, out var solution))
if (!_solutionContainerSystem.TryGetSolution(((IComponent) udder).Owner, udder.TargetSolutionName, out var solution))
continue;
//TODO: toxins from bloodstream !?
_solutionContainerSystem.TryAddReagent(udder.OwnerUid, solution, udder.ReagentId, udder.QuantityPerUpdate, out var accepted);
_solutionContainerSystem.TryAddReagent(((IComponent) udder).Owner, solution, udder.ReagentId, udder.QuantityPerUpdate, out var accepted);
udder.AccumulatedFrameTime = 0;
}
}

View File

@@ -131,7 +131,7 @@ namespace Content.Server.Arcade.Components
if (obj.Session != _player) break;
// TODO: Should this check if the Owner can interact...?
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(OwnerUid))
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(((IComponent) this).Owner))
{
DeactivePlayer(obj.Session);
break;

View File

@@ -269,7 +269,7 @@ namespace Content.Server.Atmos.Components
range = MaxExplosionRange;
}
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(OwnerUid, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1);
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(((IComponent) this).Owner, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1);
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity((EntityUid) Owner);
return;

View File

@@ -79,7 +79,7 @@ namespace Content.Server.Atmos.EntitySystems
{
airtight.AirBlocked = airblocked;
UpdatePosition(airtight);
RaiseLocalEvent(airtight.OwnerUid, new AirtightChanged(airtight));
RaiseLocalEvent(((IComponent) airtight).Owner, new AirtightChanged(airtight));
}
public void UpdatePosition(AirtightComponent airtight)

View File

@@ -201,9 +201,9 @@ namespace Content.Server.Atmos.EntitySystems
var fireStackDelta = fireStackMod - flammable.FireStacks;
if (fireStackDelta > 0)
{
AdjustFireStacks(flammable.OwnerUid, fireStackDelta, flammable);
AdjustFireStacks(((IComponent) flammable).Owner, fireStackDelta, flammable);
}
Ignite(flammable.OwnerUid, flammable);
Ignite(((IComponent) flammable).Owner, flammable);
}
_fireEvents.Clear();

View File

@@ -56,7 +56,7 @@ namespace Content.Server.Body.Systems
foreach (var (part, _) in body.Parts)
foreach (var mechanism in part.Mechanisms)
{
if (EntityManager.TryGetComponent<T>(mechanism.OwnerUid, out var comp))
if (EntityManager.TryGetComponent<T>(((IComponent) mechanism).Owner, out var comp))
yield return (comp, mechanism);
}
}

View File

@@ -14,12 +14,12 @@ namespace Content.Server.Body.Systems
{
base.Initialize();
SubscribeLocalEvent<BrainComponent, AddedToBodyEvent>((uid, component, args) => HandleMind(args.Body.OwnerUid, uid));
SubscribeLocalEvent<BrainComponent, AddedToPartEvent>((uid, component, args) => HandleMind(args.Part.OwnerUid, uid));
SubscribeLocalEvent<BrainComponent, AddedToPartInBodyEvent>((uid, component, args) => HandleMind(args.Body.OwnerUid, uid));
SubscribeLocalEvent<BrainComponent, AddedToBodyEvent>((uid, component, args) => HandleMind(((IComponent) args.Body).Owner, uid));
SubscribeLocalEvent<BrainComponent, AddedToPartEvent>((uid, component, args) => HandleMind(((IComponent) args.Part).Owner, uid));
SubscribeLocalEvent<BrainComponent, AddedToPartInBodyEvent>((uid, component, args) => HandleMind(((IComponent) args.Body).Owner, uid));
SubscribeLocalEvent<BrainComponent, RemovedFromBodyEvent>(OnRemovedFromBody);
SubscribeLocalEvent<BrainComponent, RemovedFromPartEvent>((uid, component, args) => HandleMind(uid, args.Old.OwnerUid));
SubscribeLocalEvent<BrainComponent, RemovedFromPartInBodyEvent>((uid, component, args) => HandleMind(args.OldBody.OwnerUid, uid));
SubscribeLocalEvent<BrainComponent, RemovedFromPartEvent>((uid, component, args) => HandleMind(uid, ((IComponent) args.Old).Owner));
SubscribeLocalEvent<BrainComponent, RemovedFromPartInBodyEvent>((uid, component, args) => HandleMind(((IComponent) args.OldBody).Owner, uid));
}
private void OnRemovedFromBody(EntityUid uid, BrainComponent component, RemovedFromBodyEvent args)
@@ -28,7 +28,7 @@ namespace Content.Server.Body.Systems
if (!EntityManager.TryGetComponent(uid, out MechanismComponent mech))
return;
HandleMind(mech.Part!.OwnerUid, args.Old.OwnerUid);
HandleMind(((IComponent) mech.Part!).Owner, ((IComponent) args.Old).Owner);
}
private void HandleMind(EntityUid newEntity, EntityUid oldEntity)

View File

@@ -57,7 +57,7 @@ public class LungSystem : EntitySystem
if (!Resolve(uid, ref lung, ref mech))
return;
if (mech.Body != null && EntityManager.TryGetComponent(mech.Body.OwnerUid, out MobStateComponent? mobState) && mobState.IsCritical())
if (mech.Body != null && EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out MobStateComponent? mobState) && mobState.IsCritical())
{
return;
}
@@ -111,7 +111,7 @@ public class LungSystem : EntitySystem
// TODO Jesus Christ make this event based.
if (mech.Body != null &&
EntityManager.TryGetComponent(mech.Body.OwnerUid, out InternalsComponent? internals) &&
EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out InternalsComponent? internals) &&
internals.BreathToolEntity != null &&
internals.GasTankEntity != null &&
IoCManager.Resolve<IEntityManager>().TryGetComponent(internals.BreathToolEntity, out BreathToolComponent? breathTool) &&
@@ -148,7 +148,7 @@ public class LungSystem : EntitySystem
if (mech.Body == null)
return;
if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream))
if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream))
return;
var to = bloodstream.Air;
@@ -189,10 +189,10 @@ public class LungSystem : EntitySystem
if (mech.Body == null)
return;
if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream))
if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream))
return;
_bloodstreamSystem.PumpToxins(mech.Body.OwnerUid, lung.Air, bloodstream);
_bloodstreamSystem.PumpToxins(((IComponent) mech.Body).Owner, lung.Air, bloodstream);
var lungRemoved = lung.Air.RemoveRatio(0.5f);
_atmosSys.Merge(to, lungRemoved);

View File

@@ -43,7 +43,7 @@ namespace Content.Server.Body.Systems
{
if (mech.Body != null)
{
_solutionContainerSystem.EnsureSolution(mech.Body.OwnerUid, component.SolutionName);
_solutionContainerSystem.EnsureSolution(((IComponent) mech.Body).Owner, component.SolutionName);
}
}
}
@@ -61,7 +61,7 @@ namespace Content.Server.Body.Systems
if (metab.AccumulatedFrametime >= metab.UpdateFrequency)
{
metab.AccumulatedFrametime -= metab.UpdateFrequency;
TryMetabolize(metab.OwnerUid, metab);
TryMetabolize(((IComponent) metab).Owner, metab);
}
}
}
@@ -86,9 +86,9 @@ namespace Content.Server.Body.Systems
if (body != null)
{
if (!Resolve(body.OwnerUid, ref manager, false))
if (!Resolve(((IComponent) body).Owner, ref manager, false))
return;
_solutionContainerSystem.TryGetSolution(body.OwnerUid, meta.SolutionName, out solution, manager);
_solutionContainerSystem.TryGetSolution(((IComponent) body).Owner, meta.SolutionName, out solution, manager);
solutionEntityUid = body.OwnerUid;
}
}
@@ -152,7 +152,7 @@ namespace Content.Server.Body.Systems
continue;
}
var args = new ReagentEffectArgs(solutionEntityUid.Value, meta.OwnerUid, solution, proto, entry.MetabolismRate,
var args = new ReagentEffectArgs(solutionEntityUid.Value, ((IComponent) meta).Owner, solution, proto, entry.MetabolismRate,
EntityManager, null);
// do all effects, if conditions apply

View File

@@ -32,7 +32,7 @@ namespace Content.Server.Body.Systems
foreach (var (respirator, blood, body) in
EntityManager.EntityQuery<RespiratorComponent, BloodstreamComponent, SharedBodyComponent>())
{
var uid = respirator.OwnerUid;
var uid = ((IComponent) respirator).Owner;
if (!EntityManager.TryGetComponent<MobStateComponent>(uid, out var state) ||
state.IsDead())
{
@@ -144,7 +144,7 @@ namespace Content.Server.Body.Systems
foreach (var (lung, mech) in lungs)
{
_lungSystem.UpdateLung(lung.OwnerUid, frameTime, lung, mech);
_lungSystem.UpdateLung(((IComponent) lung).Owner, frameTime, lung, mech);
}
foreach (var (gas, amountNeeded) in needs)
@@ -159,7 +159,7 @@ namespace Content.Server.Body.Systems
// Panic inhale
foreach (var (lung, mech) in lungs)
{
_lungSystem.Gasp(lung.OwnerUid, lung, mech);
_lungSystem.Gasp(((IComponent) lung).Owner, lung, mech);
}
}

View File

@@ -35,11 +35,11 @@ namespace Content.Server.Body.Systems
stomach.AccumulatedFrameTime -= stomach.UpdateInterval;
// Get our solutions
if (!_solutionContainerSystem.TryGetSolution(stomach.OwnerUid, DefaultSolutionName,
if (!_solutionContainerSystem.TryGetSolution(((IComponent) stomach).Owner, DefaultSolutionName,
out var stomachSolution, sol))
continue;
if (!_solutionContainerSystem.TryGetSolution(mech.Body.OwnerUid, stomach.BodySolutionName,
if (!_solutionContainerSystem.TryGetSolution(((IComponent) mech.Body).Owner, stomach.BodySolutionName,
out var bodySolution))
continue;
@@ -56,7 +56,7 @@ namespace Content.Server.Body.Systems
if (quant > delta.Quantity)
quant = delta.Quantity;
_solutionContainerSystem.TryRemoveReagent(stomach.OwnerUid, stomachSolution,
_solutionContainerSystem.TryRemoveReagent(((IComponent) stomach).Owner, stomachSolution,
delta.ReagentId, quant);
transferSolution.AddReagent(delta.ReagentId, quant);
}
@@ -71,7 +71,7 @@ namespace Content.Server.Body.Systems
}
// Transfer everything to the body solution!
_solutionContainerSystem.TryAddSolution(mech.Body.OwnerUid, bodySolution, transferSolution);
_solutionContainerSystem.TryAddSolution(((IComponent) mech.Body).Owner, bodySolution, transferSolution);
}
}

View File

@@ -22,7 +22,7 @@ public class ThermalRegulatorSystem : EntitySystem
continue;
regulator.AccumulatedFrametime -= 1;
ProcessThermalRegulation(regulator.OwnerUid, regulator);
ProcessThermalRegulation(((IComponent) regulator).Owner, regulator);
}
}

View File

@@ -563,10 +563,10 @@ namespace Content.Server.Botany.Components
else
{
var amt = FixedPoint2.New(1);
foreach (var reagent in solutionSystem.RemoveEachReagent(OwnerUid, solution, amt))
foreach (var reagent in solutionSystem.RemoveEachReagent(((IComponent) this).Owner, solution, amt))
{
var reagentProto = _prototypeManager.Index<ReagentPrototype>(reagent);
reagentProto.ReactionPlant(OwnerUid, new Solution.ReagentQuantity(reagent, amt), solution);
reagentProto.ReactionPlant(((IComponent) this).Owner, new Solution.ReagentQuantity(reagent, amt), solution);
}
}

View File

@@ -141,7 +141,7 @@ namespace Content.Server.Cargo.Components
// attempt to attach the label
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(product, out PaperLabelComponent label))
{
EntitySystem.Get<ItemSlotsSystem>().TryInsert(OwnerUid, label.LabelSlot, printed);
EntitySystem.Get<ItemSlotsSystem>().TryInsert(((IComponent) this).Owner, label.LabelSlot, printed);
}
}

View File

@@ -123,7 +123,7 @@ namespace Content.Server.Chemistry.Components
switch (msg.Action)
{
case UiAction.Eject:
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(OwnerUid, BeakerSlot, obj.Session.AttachedEntityUid);
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntityUid);
break;
case UiAction.ChemButton:
TransferReagent(msg.Id, msg.Amount, msg.IsBuffer);

View File

@@ -192,7 +192,7 @@ namespace Content.Server.Chemistry.Components
EntitySystem.Get<SolutionContainerSystem>().SplitSolution(user, targetBloodstream.Solution, realTransferAmount);
var bloodstreamSys = EntitySystem.Get<BloodstreamSystem>();
bloodstreamSys.TryAddToBloodstream(targetBloodstream.OwnerUid, removedSolution, targetBloodstream);
bloodstreamSys.TryAddToBloodstream(((IComponent) targetBloodstream).Owner, removedSolution, targetBloodstream);
removedSolution.DoEntityReaction(targetBloodstream.Owner, ReactionMethod.Injection);

View File

@@ -148,7 +148,7 @@ namespace Content.Server.Chemistry.Components
switch (msg.Button)
{
case UiButton.Eject:
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(OwnerUid, BeakerSlot, obj.Session.AttachedEntityUid);
EntitySystem.Get<ItemSlotsSystem>().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntityUid);
break;
case UiButton.Clear:
TryClear();

View File

@@ -38,7 +38,7 @@ namespace Content.Server.Chemistry.EntitySystems
var solToInject = solRemoved.SplitSolution(solRemovedVol * component.TransferEfficiency);
_bloodstreamSystem.TryAddToBloodstream(args.OtherFixture.Body.OwnerUid, solToInject, bloodstream);
_bloodstreamSystem.TryAddToBloodstream(((IComponent) args.OtherFixture.Body).Owner, solToInject, bloodstream);
}
}
}

View File

@@ -81,11 +81,11 @@ namespace Content.Server.Climbing.Components
// Since there are bodies with different masses:
// mass * 5 seems enough to move entity
// instead of launching cats like rockets against the walls with constant impulse value.
// instead of launching cats like rockets against the walls with constant impulse value.
Body.ApplyLinearImpulse((to - from).Normalized * velocity * Body.Mass * 5);
OwnerIsTransitioning = true;
EntitySystem.Get<ClimbSystem>().UnsetTransitionBoolAfterBufferTime(OwnerUid, this);
EntitySystem.Get<ClimbSystem>().UnsetTransitionBoolAfterBufferTime(((IComponent) this).Owner, this);
}
public void Update()

View File

@@ -125,7 +125,7 @@ namespace Content.Server.Construction.Components
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ConstructionComponent?>(Owner, out var construction))
{
// Attempt to set pathfinding to the machine node...
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(OwnerUid, "machine", construction);
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(((IComponent) this).Owner, "machine", construction);
}
}
@@ -272,7 +272,7 @@ namespace Content.Server.Construction.Components
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ConstructionComponent? construction))
{
// So prying the components off works correctly.
EntitySystem.Get<ConstructionSystem>().ResetEdge(OwnerUid, construction);
EntitySystem.Get<ConstructionSystem>().ResetEdge(((IComponent) this).Owner, construction);
}
return true;

View File

@@ -32,7 +32,7 @@ namespace Content.Server.Disposal.Tube.Components
EntitySystem.Get<AtmosphereSystem>().Merge(holderComponent.Air, from.Air);
from.Air.Clear();
return EntitySystem.Get<DisposableSystem>().EnterTube(holderComponent.OwnerUid, OwnerUid, holderComponent, null, this);
return EntitySystem.Get<DisposableSystem>().EnterTube(((IComponent) holderComponent).Owner, ((IComponent) this).Owner, holderComponent, null, this);
}
protected override Direction[] ConnectableDirections()

View File

@@ -96,7 +96,7 @@ namespace Content.Server.Disposal.Tube.Components
continue;
}
EntitySystem.Get<DisposableSystem>().ExitDisposals(holder.OwnerUid);
EntitySystem.Get<DisposableSystem>().ExitDisposals(((IComponent) holder).Owner);
}
}

View File

@@ -59,7 +59,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
if (duc != null)
{
// Insert into disposal unit
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates = new EntityCoordinates(duc.OwnerUid, Vector2.Zero);
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates = new EntityCoordinates(((IComponent) duc).Owner, Vector2.Zero);
duc.Container.Insert(entity);
}
else
@@ -154,7 +154,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
var currentTube = holder.CurrentTube;
if (currentTube == null || currentTube.Deleted)
{
ExitDisposals(holder.OwnerUid);
ExitDisposals(((IComponent) holder).Owner);
break;
}
@@ -175,15 +175,15 @@ namespace Content.Server.Disposal.Unit.EntitySystems
currentTube.Contents.ForceRemove(holder.Owner);
// Find next tube
var nextTube = _disposalTubeSystem.NextTubeFor(currentTube.OwnerUid, holder.CurrentDirection);
var nextTube = _disposalTubeSystem.NextTubeFor(currentTube.Owner, holder.CurrentDirection);
if (nextTube == null || nextTube.Deleted)
{
ExitDisposals(holder.OwnerUid);
ExitDisposals(((IComponent) holder).Owner);
break;
}
// Perform remainder of entry process
if (!EnterTube(holder.OwnerUid, nextTube.OwnerUid, holder, null, nextTube, null))
if (!EnterTube(((IComponent) holder).Owner, nextTube.Owner, holder, null, nextTube, null))
{
break;
}

View File

@@ -112,7 +112,7 @@ namespace Content.Server.Fluids.Components
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(eventArgs.Target, out PuddleComponent? puddleComponent) ||
!solutionSystem.TryGetSolution(puddleComponent.OwnerUid, puddleComponent.SolutionName, out var puddleSolution))
!solutionSystem.TryGetSolution(((IComponent) puddleComponent).Owner, puddleComponent.SolutionName, out var puddleSolution))
return false;
// So if the puddle has 20 units we mop in 2 seconds. Don't just store CurrentVolume given it can change so need to re-calc it anyway.

View File

@@ -50,7 +50,7 @@ namespace Content.Server.Ghost.Roles.Components
mob.EnsureComponent<MindComponent>();
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, OwnerUid, mob, this);
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, mob, this);
if (++_currentTakeovers < _availableTakeovers)
return true;

View File

@@ -30,10 +30,10 @@ namespace Content.Server.Ghost.Roles.Components
return false;
if (MakeSentient)
MakeSentientCommand.MakeSentient(OwnerUid, IoCManager.Resolve<IEntityManager>());
MakeSentientCommand.MakeSentient(((IComponent) this).Owner, IoCManager.Resolve<IEntityManager>());
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, OwnerUid, OwnerUid, this);
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, ((IComponent) this).Owner, this);
ghostRoleSystem.UnregisterGhostRole(this);

View File

@@ -153,7 +153,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
var mob = instrument.InstrumentPlayer.AttachedEntity;
// Just in case
Clean(instrument.OwnerUid);
Clean(((IComponent) instrument).Owner);
instrument.UserInterface?.CloseAll();
if (mob != null)

View File

@@ -207,7 +207,7 @@ namespace Content.Server.Inventory.Components
var pass = false;
reason = null;
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(OwnerUid))
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(((IComponent) this).Owner))
{
reason = Loc.GetString("inventory-component-can-equip-cannot");
return false;
@@ -295,7 +295,7 @@ namespace Content.Server.Inventory.Components
private void UpdateMovementSpeed()
{
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
}
public void ForceUnequip(Slots slot)
@@ -331,7 +331,7 @@ namespace Content.Server.Inventory.Components
/// </returns>
public bool CanUnequip(Slots slot, bool mobCheck = true)
{
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanUnequip(OwnerUid))
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanUnequip(((IComponent) this).Owner))
return false;
var inventorySlot = _slotContainers[slot];

View File

@@ -44,10 +44,10 @@ public class GrowingKudzuSystem : EntitySystem
kudzu.GrowthLevel += 1;
if (kudzu.GrowthLevel == 3 &&
EntityManager.TryGetComponent<SpreaderComponent>(kudzu.OwnerUid, out var spreader))
EntityManager.TryGetComponent<SpreaderComponent>(((IComponent) kudzu).Owner, out var spreader))
{
// why cache when you can simply cease to be? Also saves a bit of memory/time.
EntityManager.RemoveComponent<GrowingKudzuComponent>(kudzu.OwnerUid);
EntityManager.RemoveComponent<GrowingKudzuComponent>(((IComponent) kudzu).Owner);
}
appearance.SetData(KudzuVisuals.GrowthLevel, kudzu.GrowthLevel);

View File

@@ -35,7 +35,7 @@ public class SpreaderSystem : EntitySystem
private void OnAirtightChanged(AirtightChanged e)
{
UpdateNearbySpreaders(e.Airtight.OwnerUid, e.Airtight);
UpdateNearbySpreaders(((IComponent) e.Airtight).Owner, e.Airtight);
}
private void SpreaderAddHandler(EntityUid uid, SpreaderComponent component, ComponentAdd args)

View File

@@ -67,7 +67,7 @@ namespace Content.Server.Nuke
var consoles = EntityManager.EntityQuery<CommunicationsConsoleComponent>();
foreach (var console in consoles)
{
if (!EntityManager.TryGetComponent(console.OwnerUid, out TransformComponent? transform))
if (!EntityManager.TryGetComponent(((IComponent) console).Owner, out TransformComponent? transform))
continue;
var consolePos = transform.MapPosition;

View File

@@ -90,7 +90,7 @@ namespace Content.Server.Nutrition.Components
if (_lastHungerThreshold == HungerThreshold.Starving && _currentHungerThreshold != HungerThreshold.Dead &&
IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent))
{
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
}
// Update UI
@@ -126,7 +126,7 @@ namespace Content.Server.Nutrition.Components
case HungerThreshold.Starving:
// TODO: If something else bumps this could cause mega-speed.
// If some form of speed update system if multiple things are touching it use that.
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
_lastHungerThreshold = _currentHungerThreshold;
_actualDecayRate = _baseDecayRate * 0.6f;
return;

View File

@@ -89,7 +89,7 @@ namespace Content.Server.Nutrition.Components
if (_lastThirstThreshold == ThirstThreshold.Parched && _currentThirstThreshold != ThirstThreshold.Dead &&
IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent))
{
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
}
// Update UI
@@ -123,7 +123,7 @@ namespace Content.Server.Nutrition.Components
return;
case ThirstThreshold.Parched:
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
_lastThirstThreshold = _currentThirstThreshold;
_actualDecayRate = _baseDecayRate * 0.6f;
return;

View File

@@ -218,13 +218,13 @@ namespace Content.Server.Nutrition.EntitySystems
public void UpdateAppearance(DrinkComponent component)
{
if (!EntityManager.TryGetComponent(component.OwnerUid, out AppearanceComponent? appearance) ||
!EntityManager.HasComponent<SolutionContainerManagerComponent>(component.OwnerUid))
if (!EntityManager.TryGetComponent(((IComponent) component).Owner, out AppearanceComponent? appearance) ||
!EntityManager.HasComponent<SolutionContainerManagerComponent>(((IComponent) component).Owner))
{
return;
}
var drainAvailable = _solutionContainerSystem.DrainAvailable(component.OwnerUid);
var drainAvailable = _solutionContainerSystem.DrainAvailable(((IComponent) component).Owner);
appearance.SetData(FoodVisuals.Visual, drainAvailable.Float());
appearance.SetData(DrinkCanStateVisual.Opened, component.Opened);
}
@@ -248,7 +248,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (!EntityManager.TryGetComponent(userUid, out SharedBodyComponent? body))
return false;
if (!_solutionContainerSystem.TryGetDrainableSolution(drink.OwnerUid, out var drinkSolution) ||
if (!_solutionContainerSystem.TryGetDrainableSolution(((IComponent) drink).Owner, out var drinkSolution) ||
drinkSolution.DrainAvailable <= 0)
{
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
@@ -274,7 +274,7 @@ namespace Content.Server.Nutrition.EntitySystems
var transferAmount = FixedPoint2.Min(drink.TransferAmount, drinkSolution.DrainAvailable);
var drain = _solutionContainerSystem.Drain(uid, drinkSolution, transferAmount);
var firstStomach = stomachs.FirstOrNull(
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, drain));
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, drain));
// All stomach are full or can't handle whatever solution we have.
if (firstStomach == null)
@@ -299,7 +299,7 @@ namespace Content.Server.Nutrition.EntitySystems
Filter.Pvs(userUid));
drain.DoEntityReaction(userUid, ReactionMethod.Ingestion);
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, drain, firstStomach.Value.Comp);
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, drain, firstStomach.Value.Comp);
return true;
}
@@ -378,7 +378,7 @@ namespace Content.Server.Nutrition.EntitySystems
{
args.Drink.InUse = false;
var transferAmount = FixedPoint2.Min(args.Drink.TransferAmount, args.DrinkSolution.DrainAvailable);
var drained = _solutionContainerSystem.Drain(args.Drink.OwnerUid, args.DrinkSolution, transferAmount);
var drained = _solutionContainerSystem.Drain(((IComponent) args.Drink).Owner, args.DrinkSolution, transferAmount);
if (!_bodySystem.TryGetComponentsOnMechanisms<StomachComponent>(uid, out var stomachs, body))
{
@@ -390,7 +390,7 @@ namespace Content.Server.Nutrition.EntitySystems
}
var firstStomach = stomachs.FirstOrNull(
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, drained));
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, drained));
// All stomach are full or can't handle whatever solution we have.
if (firstStomach == null)
@@ -417,7 +417,7 @@ namespace Content.Server.Nutrition.EntitySystems
SoundSystem.Play(Filter.Pvs(uid), args.Drink.UseSound.GetSound(), uid, AudioParams.Default.WithVolume(-2f));
drained.DoEntityReaction(uid, ReactionMethod.Ingestion);
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, drained, firstStomach.Value.Comp);
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, drained, firstStomach.Value.Comp);
}
private void OnForceDrinkCancelled(ForceDrinkCancelledEvent args)

View File

@@ -158,7 +158,7 @@ namespace Content.Server.Nutrition.EntitySystems
var transferAmount = component.TransferAmount != null ? FixedPoint2.Min((FixedPoint2) component.TransferAmount, solution.CurrentVolume) : solution.CurrentVolume;
var split = _solutionContainerSystem.SplitSolution(uid, solution, transferAmount);
var firstStomach = stomachs.FirstOrNull(
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, split));
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, split));
if (firstStomach == null)
{
@@ -169,7 +169,7 @@ namespace Content.Server.Nutrition.EntitySystems
// TODO: Account for partial transfer.
split.DoEntityReaction(userUid, ReactionMethod.Ingestion);
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, split, firstStomach.Value.Comp);
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, split, firstStomach.Value.Comp);
SoundSystem.Play(Filter.Pvs(userUid), component.UseSound.GetSound(), userUid, AudioParams.Default.WithVolume(-1f));
_popupSystem.PopupEntity(Loc.GetString(component.EatMessage, ("food", component.Owner)), userUid, Filter.Entities(userUid));
@@ -177,7 +177,7 @@ namespace Content.Server.Nutrition.EntitySystems
// Try to break all used utensils
foreach (var utensil in usedUtensils)
{
_utensilSystem.TryBreak(utensil.OwnerUid, userUid);
_utensilSystem.TryBreak(((IComponent) utensil).Owner, userUid);
}
if (component.UsesRemaining > 0)
@@ -186,7 +186,7 @@ namespace Content.Server.Nutrition.EntitySystems
}
if (string.IsNullOrEmpty(component.TrashPrototype))
EntityManager.QueueDeleteEntity(component.OwnerUid);
EntityManager.QueueDeleteEntity(((IComponent) component).Owner);
else
DeleteAndSpawnTrash(component, userUid);
@@ -204,7 +204,7 @@ namespace Content.Server.Nutrition.EntitySystems
EntityManager.TryGetComponent(userUid.Value, out HandsComponent? handsComponent) &&
handsComponent.IsHolding(component.Owner))
{
EntityManager.DeleteEntity(component.OwnerUid);
EntityManager.DeleteEntity(((IComponent) component).Owner);
// Put the trash in the user's hand
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(finisher, out ItemComponent? item) &&
@@ -215,7 +215,7 @@ namespace Content.Server.Nutrition.EntitySystems
return;
}
EntityManager.QueueDeleteEntity(component.OwnerUid);
EntityManager.QueueDeleteEntity(((IComponent) component).Owner);
}
private void AddEatVerb(EntityUid uid, FoodComponent component, GetInteractionVerbsEvent ev)
@@ -313,9 +313,9 @@ namespace Content.Server.Nutrition.EntitySystems
? FixedPoint2.Min((FixedPoint2) args.Food.TransferAmount, args.FoodSolution.CurrentVolume)
: args.FoodSolution.CurrentVolume;
var split = _solutionContainerSystem.SplitSolution(args.Food.OwnerUid, args.FoodSolution, transferAmount);
var split = _solutionContainerSystem.SplitSolution(((IComponent) args.Food).Owner, args.FoodSolution, transferAmount);
var firstStomach = stomachs.FirstOrNull(
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, split));
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, split));
if (firstStomach == null)
{
@@ -325,7 +325,7 @@ namespace Content.Server.Nutrition.EntitySystems
}
split.DoEntityReaction(uid, ReactionMethod.Ingestion);
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, split, firstStomach.Value.Comp);
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, split, firstStomach.Value.Comp);
EntityManager.TryGetComponent(uid, out MetaDataComponent? targetMeta);
var targetName = targetMeta?.EntityName ?? string.Empty;
@@ -344,14 +344,14 @@ namespace Content.Server.Nutrition.EntitySystems
// Try to break all used utensils
foreach (var utensil in args.Utensils)
{
_utensilSystem.TryBreak(utensil.OwnerUid, args.User);
_utensilSystem.TryBreak(((IComponent) utensil).Owner, args.User);
}
if (args.Food.UsesRemaining > 0)
return;
if (string.IsNullOrEmpty(args.Food.TrashPrototype))
EntityManager.QueueDeleteEntity(args.Food.OwnerUid);
EntityManager.QueueDeleteEntity(((IComponent) args.Food).Owner);
else
DeleteAndSpawnTrash(args.Food, args.User);
}
@@ -377,7 +377,7 @@ namespace Content.Server.Nutrition.EntitySystems
DeleteAndSpawnTrash(food);
var firstStomach = stomachs.FirstOrNull(
stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, foodSolution));
stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, foodSolution));
if (firstStomach == null)
return;
@@ -395,11 +395,11 @@ namespace Content.Server.Nutrition.EntitySystems
_popupSystem.PopupEntity(Loc.GetString(food.EatMessage), target, filter);
foodSolution.DoEntityReaction(uid, ReactionMethod.Ingestion);
_stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, foodSolution, firstStomach.Value.Comp);
_stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, foodSolution, firstStomach.Value.Comp);
SoundSystem.Play(Filter.Pvs(target), food.UseSound.GetSound(), target, AudioParams.Default.WithVolume(-1f));
if (string.IsNullOrEmpty(food.TrashPrototype))
EntityManager.QueueDeleteEntity(food.OwnerUid);
EntityManager.QueueDeleteEntity(((IComponent) food).Owner);
else
DeleteAndSpawnTrash(food);
}
@@ -470,7 +470,7 @@ namespace Content.Server.Nutrition.EntitySystems
// check helmets. Note that not all helmets cover the face.
if (inventory.TryGetSlotItem(EquipmentSlotDefines.Slots.HEAD, out ItemComponent? head) &&
EntityManager.TryGetComponent(head.OwnerUid, out TagComponent tag) &&
EntityManager.TryGetComponent(((IComponent) head).Owner, out TagComponent tag) &&
tag.HasTag("ConcealsFace"))
{
blockingEntity = head.OwnerUid;

View File

@@ -108,7 +108,7 @@ namespace Content.Server.Physics.Controllers
// then do the movement input once for it.
foreach (var (shuttle, pilots) in _shuttlePilots)
{
if (shuttle.Paused || !EntityManager.TryGetComponent(shuttle.OwnerUid, out PhysicsComponent? body)) continue;
if (shuttle.Paused || !EntityManager.TryGetComponent(((IComponent) shuttle).Owner, out PhysicsComponent? body)) continue;
// Collate movement linear and angular inputs together
var linearInput = Vector2.Zero;
@@ -131,7 +131,7 @@ namespace Content.Server.Physics.Controllers
if (sprint.Equals(Vector2.Zero)) continue;
var offsetRotation = EntityManager.GetComponent<TransformComponent>(console.OwnerUid).LocalRotation;
var offsetRotation = EntityManager.GetComponent<TransformComponent>(((IComponent) console).Owner).LocalRotation;
linearInput += offsetRotation.RotateVec(new Vector2(0f, sprint.Y));
angularInput += sprint.X;
@@ -153,7 +153,7 @@ namespace Content.Server.Physics.Controllers
if (sprint.Equals(Vector2.Zero)) continue;
var offsetRotation = EntityManager.GetComponent<TransformComponent>(console.OwnerUid).LocalRotation;
var offsetRotation = EntityManager.GetComponent<TransformComponent>(((IComponent) console).Owner).LocalRotation;
sprint = offsetRotation.RotateVec(sprint);
linearInput += sprint;
@@ -180,7 +180,7 @@ namespace Content.Server.Physics.Controllers
var angle = linearInput.ToWorldAngle();
var linearDir = angle.GetDir();
var dockFlag = linearDir.AsFlag();
var shuttleNorth = EntityManager.GetComponent<TransformComponent>(body.OwnerUid).WorldRotation.ToWorldVec();
var shuttleNorth = EntityManager.GetComponent<TransformComponent>(((IComponent) body).Owner).WorldRotation.ToWorldVec();
// Won't just do cardinal directions.
foreach (DirectionFlag dir in Enum.GetValues(typeof(DirectionFlag)))

View File

@@ -180,7 +180,7 @@ namespace Content.Server.PneumaticCannon
if (storage.StoredEntities == null) return;
if (storage.StoredEntities.Count == 0)
{
SoundSystem.Play(Filter.Pvs(comp.OwnerUid), "/Audio/Weapons/click.ogg", comp.OwnerUid, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(((IComponent) comp).Owner), "/Audio/Weapons/click.ogg", ((IComponent) comp).Owner, AudioParams.Default);
return;
}
@@ -217,7 +217,7 @@ namespace Content.Server.PneumaticCannon
{
data.User.PopupMessage(Loc.GetString("pneumatic-cannon-component-fire-no-gas",
("cannon", comp.Owner)));
SoundSystem.Play(Filter.Pvs(comp.OwnerUid), "/Audio/Items/hiss.ogg", comp.OwnerUid, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(((IComponent) comp).Owner), "/Audio/Items/hiss.ogg", ((IComponent) comp).Owner, AudioParams.Default);
return;
}
@@ -233,7 +233,7 @@ namespace Content.Server.PneumaticCannon
IEntity ent = _random.Pick(storage.StoredEntities);
storage.Remove(ent);
SoundSystem.Play(Filter.Pvs(data.User), comp.FireSound.GetSound(), comp.OwnerUid, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(data.User), comp.FireSound.GetSound(), ((IComponent) comp).Owner, AudioParams.Default);
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<CameraRecoilComponent?>(data.User, out var recoil))
{
recoil.Kick(Vector2.One * data.Strength);

View File

@@ -68,7 +68,7 @@ namespace Content.Server.Power.EntitySystems
{
// No point resetting what the receiver is doing if it's deleting, plus significant perf savings
// in not doing needless lookups
if (EntityManager.GetComponent<MetaDataComponent>(receiver.OwnerUid).EntityLifeStage >
if (EntityManager.GetComponent<MetaDataComponent>(((IComponent) receiver).Owner).EntityLifeStage >
EntityLifeStage.MapInitialized) continue;
TryFindAndSetProvider(receiver);

View File

@@ -73,7 +73,7 @@ namespace Content.Server.PowerCell.Components
var light = (int) Math.Ceiling(Math.Sqrt(CurrentCharge) / 30);
CurrentCharge = 0;
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(OwnerUid, 0, heavy, light, light*2);
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(((IComponent) this).Owner, 0, heavy, light, light*2);
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) Owner);
}

View File

@@ -33,11 +33,11 @@ namespace Content.Server.Shuttles.Components
if (!_enabled)
{
system.DisableThruster(OwnerUid, this);
system.DisableThruster(((IComponent) this).Owner, this);
}
else if (system.CanEnable(OwnerUid, this))
else if (system.CanEnable(((IComponent) this).Owner, this))
{
system.EnableThruster(OwnerUid, this);
system.EnableThruster(((IComponent) this).Owner, this);
}
}
}

View File

@@ -112,7 +112,7 @@ namespace Content.Server.Shuttles.EntitySystems
if (dockingFixture == null)
{
DebugTools.Assert(false);
Logger.ErrorS("docking", $"Found null fixture on {EntityManager.GetEntity(body.OwnerUid)}");
Logger.ErrorS("docking", $"Found null fixture on {EntityManager.GetEntity(((IComponent) body).Owner)}");
return null;
}
@@ -183,7 +183,7 @@ namespace Content.Server.Shuttles.EntitySystems
if (dockB == null || dockA.DockJoint == null)
{
DebugTools.Assert(false);
Logger.Error("docking", $"Tried to cleanup {dockA.OwnerUid} but not docked?");
Logger.Error("docking", $"Tried to cleanup {((IComponent) dockA).Owner} but not docked?");
dockA.DockedWith = null;
if (dockA.DockJoint != null)
@@ -202,8 +202,8 @@ namespace Content.Server.Shuttles.EntitySystems
dockA.DockedWith = null;
// If these grids are ever invalid then need to look at fixing ordering for unanchored events elsewhere.
var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(dockA.OwnerUid).GridID).GridEntityId;
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(dockB.OwnerUid).GridID).GridEntityId;
var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).Owner).GridID).GridEntityId;
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner).GridID).GridEntityId;
var msg = new UndockEvent
{
@@ -213,8 +213,8 @@ namespace Content.Server.Shuttles.EntitySystems
GridBUid = gridBUid,
};
EntityManager.EventBus.RaiseLocalEvent(dockA.OwnerUid, msg, false);
EntityManager.EventBus.RaiseLocalEvent(dockB.OwnerUid, msg, false);
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
}
@@ -310,8 +310,8 @@ namespace Content.Server.Shuttles.EntitySystems
// We could also potentially use a prismatic joint? Depending if we want clamps that can extend or whatever
var dockAXform = EntityManager.GetComponent<TransformComponent>(dockA.OwnerUid);
var dockBXform = EntityManager.GetComponent<TransformComponent>(dockB.OwnerUid);
var dockAXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).Owner);
var dockBXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner);
var gridA = _mapManager.GetGrid(dockAXform.GridID).GridEntityId;
var gridB = _mapManager.GetGrid(dockBXform.GridID).GridEntityId;
@@ -326,7 +326,7 @@ namespace Content.Server.Shuttles.EntitySystems
// These need playing around with
// Could also potentially have collideconnected false and stiffness 0 but it was a bit more suss???
var joint = _jointSystem.CreateWeldJoint(gridA, gridB, DockingJoint + dockA.OwnerUid);
var joint = _jointSystem.CreateWeldJoint(gridA, gridB, DockingJoint + ((IComponent) dockA).Owner);
var gridAXform = EntityManager.GetComponent<TransformComponent>(gridA);
var gridBXform = EntityManager.GetComponent<TransformComponent>(gridB);
@@ -346,13 +346,13 @@ namespace Content.Server.Shuttles.EntitySystems
dockA.DockJoint = joint;
dockB.DockJoint = joint;
if (EntityManager.TryGetComponent(dockA.OwnerUid, out ServerDoorComponent? doorA))
if (EntityManager.TryGetComponent(((IComponent) dockA).Owner, out ServerDoorComponent? doorA))
{
doorA.ChangeAirtight = false;
doorA.Open();
}
if (EntityManager.TryGetComponent(dockB.OwnerUid, out ServerDoorComponent? doorB))
if (EntityManager.TryGetComponent(((IComponent) dockB).Owner, out ServerDoorComponent? doorB))
{
doorB.ChangeAirtight = false;
doorB.Open();
@@ -366,8 +366,8 @@ namespace Content.Server.Shuttles.EntitySystems
GridBUid = gridB,
};
EntityManager.EventBus.RaiseLocalEvent(dockA.OwnerUid, msg, false);
EntityManager.EventBus.RaiseLocalEvent(dockB.OwnerUid, msg, false);
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
}
@@ -376,8 +376,8 @@ namespace Content.Server.Shuttles.EntitySystems
/// </summary>
private void TryDock(DockingComponent dockA, DockingComponent dockB)
{
if (!EntityManager.TryGetComponent(dockA.OwnerUid, out PhysicsComponent? bodyA) ||
!EntityManager.TryGetComponent(dockB.OwnerUid, out PhysicsComponent? bodyB) ||
if (!EntityManager.TryGetComponent(((IComponent) dockA).Owner, out PhysicsComponent? bodyA) ||
!EntityManager.TryGetComponent(((IComponent) dockB).Owner, out PhysicsComponent? bodyB) ||
!dockA.Enabled ||
!dockB.Enabled)
{
@@ -423,17 +423,17 @@ namespace Content.Server.Shuttles.EntitySystems
if (dock.DockedWith == null)
{
DebugTools.Assert(false);
Logger.ErrorS("docking", $"Tried to undock {dock.OwnerUid} but not docked with anything?");
Logger.ErrorS("docking", $"Tried to undock {((IComponent) dock).Owner} but not docked with anything?");
return;
}
if (EntityManager.TryGetComponent(dock.OwnerUid, out ServerDoorComponent? doorA))
if (EntityManager.TryGetComponent(((IComponent) dock).Owner, out ServerDoorComponent? doorA))
{
doorA.ChangeAirtight = true;
doorA.Close();
}
if (EntityManager.TryGetComponent(dock.DockedWith.OwnerUid, out ServerDoorComponent? doorB))
if (EntityManager.TryGetComponent(((IComponent) dock.DockedWith).Owner, out ServerDoorComponent? doorB))
{
doorB.ChangeAirtight = true;
doorB.Close();

View File

@@ -39,7 +39,7 @@ namespace Content.Server.Shuttles.EntitySystems
{
if (comp.Console == null) continue;
if (!_blocker.CanInteract(comp.OwnerUid))
if (!_blocker.CanInteract(((IComponent) comp).Owner))
{
toRemove.Add(comp);
}

View File

@@ -397,14 +397,14 @@ namespace Content.Server.Shuttles.EntitySystems
if (args.OurFixture.ID != BurnFixture) return;
_activeThrusters.Add(component);
component.Colliding.Add(args.OtherFixture.Body.OwnerUid);
component.Colliding.Add(((IComponent) args.OtherFixture.Body).Owner);
}
private void OnEndCollide(EntityUid uid, ThrusterComponent component, EndCollideEvent args)
{
if (args.OurFixture.ID != BurnFixture) return;
component.Colliding.Remove(args.OtherFixture.Body.OwnerUid);
component.Colliding.Remove(((IComponent) args.OtherFixture.Body).Owner);
if (component.Colliding.Count == 0)
{
@@ -425,7 +425,7 @@ namespace Content.Server.Shuttles.EntitySystems
foreach (var comp in component.LinearThrusters[index])
{
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
continue;
comp.Firing = true;
@@ -446,7 +446,7 @@ namespace Content.Server.Shuttles.EntitySystems
foreach (var comp in component.LinearThrusters[index])
{
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
continue;
comp.Firing = false;
@@ -470,7 +470,7 @@ namespace Content.Server.Shuttles.EntitySystems
{
foreach (var comp in component.AngularThrusters)
{
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
continue;
comp.Firing = true;
@@ -481,7 +481,7 @@ namespace Content.Server.Shuttles.EntitySystems
{
foreach (var comp in component.AngularThrusters)
{
if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent))
if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent))
continue;
comp.Firing = false;

View File

@@ -166,7 +166,7 @@ namespace Content.Server.Solar.EntitySystems
// Total coverage calculated; apply it to the panel.
panel.Coverage = coverage;
UpdateSupply(panel.OwnerUid, panel);
UpdateSupply(((IComponent) panel).Owner, panel);
}
public void UpdateSupply(

View File

@@ -70,7 +70,8 @@ namespace Content.Server.StationEvents.Events
// Account for split stations by just randomly picking a piece of it.
var possibleTargets = _entityManager.EntityQuery<StationComponent>()
.Where(x => x.Station == _target).ToArray();
var stationEnt = _robustRandom.Pick(possibleTargets).OwnerUid;
StationComponent tempQualifier = _robustRandom.Pick(possibleTargets);
var stationEnt = ((IComponent) tempQualifier).Owner;
if (!_entityManager.TryGetComponent<IMapGridComponent>(stationEnt, out var grid))
return;

View File

@@ -225,7 +225,7 @@ namespace Content.Server.Storage.Components
var targetIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(entity);
var targetIsMob = IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(entity);
var storageIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(OwnerUid);
var storageIsItem = IoCManager.Resolve<IEntityManager>().HasComponent<SharedItemComponent>(((IComponent) this).Owner);
var allowedToEat = false;

View File

@@ -94,7 +94,7 @@ namespace Content.Server.Storage.Components
private void UpdateStorageVisualization()
{
if (!_entityManager.TryGetComponent(OwnerUid, out AppearanceComponent appearance))
if (!_entityManager.TryGetComponent(((IComponent) this).Owner, out AppearanceComponent appearance))
return;
bool open = SubscribedSessions.Count != 0;
@@ -102,7 +102,7 @@ namespace Content.Server.Storage.Components
appearance.SetData(StorageVisuals.Open, open);
appearance.SetData(SharedBagOpenVisuals.BagState, open ? SharedBagState.Open : SharedBagState.Closed);
if (_entityManager.HasComponent<ItemCounterComponent>(OwnerUid))
if (_entityManager.HasComponent<ItemCounterComponent>(((IComponent) this).Owner))
appearance.SetData(StackVisuals.Hide, !open);
}
@@ -402,7 +402,7 @@ namespace Content.Server.Storage.Components
{
if (_entityManager.TryGetComponent(entity, out ServerStorageComponent storageComponent))
{
DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {OwnerUid}");
DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {((IComponent) this).Owner}");
storageComponent.UnsubscribeSession(session);
}

View File

@@ -103,7 +103,7 @@ namespace Content.Server.Tabletop
return;
};
var gamerUid = gamer.OwnerUid;
var gamerUid = ((IComponent) gamer).Owner;
if (actor.PlayerSession.Status > SessionStatus.Connected || CanSeeTable(gamerUid, gamer.Tabletop)
|| !StunnedOrNoHands(gamerUid))

View File

@@ -59,7 +59,7 @@ namespace Content.Server.Temperature.Systems
if (comp.Deleted || comp.Paused)
continue;
ChangeDamage(comp.OwnerUid, comp);
ChangeDamage(((IComponent) comp).Owner, comp);
}
ShouldUpdateDamage.Clear();

View File

@@ -91,10 +91,10 @@ namespace Content.Server.UserInterface
// If we've gotten this far, fire a cancellable event that indicates someone is about to activate this.
// This is so that stuff can require further conditions (like power).
var oae = new ActivatableUIOpenAttemptEvent(user);
RaiseLocalEvent(aui.OwnerUid, oae, false);
RaiseLocalEvent(((IComponent) aui).Owner, oae, false);
if (oae.Cancelled) return false;
SetCurrentSingleUser(aui.OwnerUid, actor.PlayerSession, aui);
SetCurrentSingleUser(((IComponent) aui).Owner, actor.PlayerSession, aui);
ui.Toggle(actor.PlayerSession);
return true;
}

View File

@@ -287,7 +287,7 @@ namespace Content.Server.Weapon.Melee
foreach (var bloodstream in hitBloodstreams)
{
var individualInjection = solutionToInject.SplitSolution(volPerBloodstream);
_bloodstreamSystem.TryAddToBloodstream(bloodstream.OwnerUid, individualInjection, bloodstream);
_bloodstreamSystem.TryAddToBloodstream(((IComponent) bloodstream).Owner, individualInjection, bloodstream);
}
}

View File

@@ -365,7 +365,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(projectile).WorldRotation = projectileAngle + MathHelper.PiOver2;
}
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnerUid, new GunShotEvent(firedProjectiles));
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new GunShotEvent(firedProjectiles));
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(ammo, new AmmoShotEvent(firedProjectiles));
}