Merge remote-tracking branch 'Zumorica/2021-12-03-remove-IEntity-komm-süsser-todd' into 2021-12-03-remove-IEntity-komm-süsser-todd
# Conflicts: # Content.Server/DeviceNetwork/Systems/WiredNetworkSystem.cs # Content.Server/Hands/Systems/HandsSystem.cs # Content.Server/Radio/Components/IRadio.cs # Content.Server/UserInterface/ActivatableUISystem.cs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Content.Shared.Conveyor;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -23,7 +23,7 @@ namespace Content.Client.Conveyor.Visualizers
|
||||
private void ChangeState(AppearanceComponent appearance)
|
||||
{
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
||||
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -45,8 +45,8 @@ namespace Content.Client.Conveyor.Visualizers
|
||||
public override void InitializeEntity(EntityUid entity)
|
||||
{
|
||||
base.InitializeEntity(entity);
|
||||
|
||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
var appearance = entities.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||
ChangeState(appearance);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Client.Conveyor.Visualizers
|
||||
private void ChangeState(AppearanceComponent appearance)
|
||||
{
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
||||
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -44,7 +44,8 @@ namespace Content.Client.Conveyor.Visualizers
|
||||
{
|
||||
base.InitializeEntity(entity);
|
||||
|
||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
var appearance = entities.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||
ChangeState(appearance);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Content.Client.Disposal.Visualizers
|
||||
}
|
||||
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
||||
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace Content.Client.Disposal.Visualizers
|
||||
case VisualState.Flushing:
|
||||
sprite.LayerSetState(DisposalUnitVisualLayers.Base, _stateAnchored);
|
||||
|
||||
var animPlayer = IoCManager.Resolve<IEntityManager>().GetComponent<AnimationPlayerComponent>(appearance.Owner);
|
||||
var animPlayer = IoCManager.Resolve<IEntityManager>().GetComponent<AnimationPlayerComponent>(appearance.OwnerUid);
|
||||
|
||||
if (!animPlayer.HasRunningAnimation(AnimationKey))
|
||||
{
|
||||
@@ -148,9 +148,9 @@ namespace Content.Client.Disposal.Visualizers
|
||||
public override void InitializeEntity(EntityUid entity)
|
||||
{
|
||||
base.InitializeEntity(entity);
|
||||
|
||||
entity.EnsureComponent<AnimationPlayerComponent>();
|
||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
entities.EnsureComponent<AnimationPlayerComponent>(entity);
|
||||
var appearance = entities.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||
|
||||
ChangeState(appearance);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Client.Disposal.Visualizers
|
||||
private void ChangeState(AppearanceComponent appearance)
|
||||
{
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(appearance.Owner, out ISpriteComponent? sprite))
|
||||
if (!entities.TryGetComponent(appearance.OwnerUid, out ISpriteComponent? sprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -48,17 +48,17 @@ namespace Content.Client.Disposal.Visualizers
|
||||
{
|
||||
appearance.Owner.EnsureComponent<SubFloorHideComponent>();
|
||||
}
|
||||
else if (IoCManager.Resolve<IEntityManager>().HasComponent<SubFloorHideComponent>(appearance.Owner))
|
||||
else if (IoCManager.Resolve<IEntityManager>().HasComponent<SubFloorHideComponent>(appearance.OwnerUid))
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().RemoveComponent<SubFloorHideComponent>(appearance.Owner);
|
||||
IoCManager.Resolve<IEntityManager>().RemoveComponent<SubFloorHideComponent>(appearance.OwnerUid);
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitializeEntity(EntityUid entity)
|
||||
{
|
||||
base.InitializeEntity(entity);
|
||||
|
||||
var appearance = entity.EnsureComponent<ClientAppearanceComponent>();
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var appearance = entityManager.EnsureComponent<ClientAppearanceComponent>(entity);
|
||||
ChangeState(appearance);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Content.Client.Singularity
|
||||
var distortions = _entityManager.EntityQuery<SingularityDistortionComponent>();
|
||||
foreach (var distortion in distortions) //Add all singulos that are not added yet but qualify
|
||||
{
|
||||
var singuloEntity = distortion.Owner;
|
||||
var singuloEntity = distortion.OwnerUid;
|
||||
|
||||
if (!_singularities.Keys.Contains(singuloEntity) && SinguloQualifies(singuloEntity, currentEyeLoc))
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Content.Client.StationEvents
|
||||
var pulses = _entityManager.EntityQuery<RadiationPulseComponent>();
|
||||
foreach (var pulse in pulses) //Add all pulses that are not added yet but qualify
|
||||
{
|
||||
var pulseEntity = pulse.Owner;
|
||||
var pulseEntity = pulse.OwnerUid;
|
||||
|
||||
if (!_pulses.Keys.Contains(pulseEntity) && PulseQualifies(pulseEntity, currentEyeLoc))
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Content.Server.Access.Systems
|
||||
{
|
||||
if (inventoryComponent.HasSlot(EquipmentSlotDefines.Slots.IDCARD) &&
|
||||
inventoryComponent.TryGetSlotItem(EquipmentSlotDefines.Slots.IDCARD, out ItemComponent? item) &&
|
||||
FindAccessTagsItem(item.Owner, out tags)
|
||||
FindAccessTagsItem(item.OwnerUid, out tags)
|
||||
)
|
||||
{
|
||||
return tags;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Content.Server.Advertise
|
||||
return;
|
||||
|
||||
if (_prototypeManager.TryIndex(advertise.PackPrototypeId, out AdvertisementsPackPrototype? advertisements))
|
||||
_chatManager.EntitySay(advertise.Owner, Loc.GetString(_random.Pick(advertisements.Advertisements)), hideChat: true);
|
||||
_chatManager.EntitySay(advertise.OwnerUid, Loc.GetString(_random.Pick(advertisements.Advertisements)), hideChat: true);
|
||||
|
||||
if(refresh)
|
||||
RefreshTimer(uid, true, advertise);
|
||||
@@ -117,7 +117,7 @@ namespace Content.Server.Advertise
|
||||
if (advertise.NextAdvertisementTime > curTime)
|
||||
continue;
|
||||
|
||||
SayAdvertisement(advertise.Owner, true, advertise);
|
||||
SayAdvertisement(advertise.OwnerUid, true, advertise);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
if (airtight.FixAirBlockedDirectionInitialize)
|
||||
{
|
||||
var rotateEvent = new RotateEvent(airtight.Owner, Angle.Zero, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).WorldRotation);
|
||||
var rotateEvent = new RotateEvent(airtight.OwnerUid, Angle.Zero, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(airtight.Owner).WorldRotation);
|
||||
OnAirtightRotated(uid, airtight, ref rotateEvent);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
airtight.AirBlocked = airblocked;
|
||||
UpdatePosition(airtight);
|
||||
RaiseLocalEvent(((IComponent) airtight).Owner, new AirtightChanged(airtight));
|
||||
RaiseLocalEvent(((IComponent) airtight).OwnerUid, new AirtightChanged(airtight));
|
||||
}
|
||||
|
||||
public void UpdatePosition(AirtightComponent airtight)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Radio.Components;
|
||||
using Content.Shared.Chat;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Content.Server.Hands.Systems
|
||||
{
|
||||
var player = session?.AttachedEntity;
|
||||
|
||||
if (player == default)
|
||||
if (!player.HasValue || !player.Value.IsValid())
|
||||
return false;
|
||||
|
||||
if (!EntityManager.TryGetComponent(player.Value, out SharedHandsComponent? hands))
|
||||
@@ -189,10 +189,12 @@ namespace Content.Server.Hands.Systems
|
||||
if (session is not IPlayerSession playerSession)
|
||||
return false;
|
||||
|
||||
if (playerSession.AttachedEntity is not {Valid: true} playerEnt || !EntityManager.EntityExists(playerEnt))
|
||||
var player = playerSession.AttachedEntity;
|
||||
|
||||
if (!player.HasValue || !player.Value.IsValid())
|
||||
return false;
|
||||
|
||||
return EntityManager.TryGetComponent(playerEnt, out hands);
|
||||
return EntityManager.TryGetComponent(player.Value, out hands);
|
||||
}
|
||||
|
||||
private void HandleActivateItem(ICommonSession? session)
|
||||
@@ -216,12 +218,15 @@ namespace Content.Server.Hands.Systems
|
||||
if (session is not IPlayerSession playerSession)
|
||||
return false;
|
||||
|
||||
if (playerSession.AttachedEntity is not {Valid: true} playerEnt ||
|
||||
!EntityManager.EntityExists(playerEnt) ||
|
||||
playerEnt.IsInContainer() ||
|
||||
!EntityManager.TryGetComponent(playerEnt, out SharedHandsComponent? hands) ||
|
||||
var maybePlayer = playerSession.AttachedEntity;
|
||||
if (!maybePlayer.HasValue) return false;
|
||||
var player = maybePlayer.Value;
|
||||
|
||||
if (!EntityManager.EntityExists(player) ||
|
||||
player.IsInContainer() ||
|
||||
!EntityManager.TryGetComponent(player, out SharedHandsComponent? hands) ||
|
||||
!hands.TryGetActiveHeldEntity(out var throwEnt) ||
|
||||
!_actionBlockerSystem.CanThrow(playerEnt))
|
||||
!_actionBlockerSystem.CanThrow(player))
|
||||
return false;
|
||||
|
||||
if (EntityManager.TryGetComponent(throwEnt, out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
|
||||
@@ -271,7 +276,7 @@ namespace Content.Server.Hands.Systems
|
||||
return;
|
||||
|
||||
if (!inventory.TryGetSlotItem(equipmentSlot, out ItemComponent? equipmentItem) ||
|
||||
!EntityManager.TryGetComponent(equipmentItem.Owner, out ServerStorageComponent? storageComponent))
|
||||
!EntityManager.TryGetComponent(equipmentItem.OwnerUid, out ServerStorageComponent? storageComponent))
|
||||
{
|
||||
plyEnt.PopupMessage(Loc.GetString("hands-system-missing-equipment-slot", ("slotName", SlotNames[equipmentSlot].ToLower())));
|
||||
return;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.Headset
|
||||
{
|
||||
if (Owner.TryGetContainer(out var container))
|
||||
{
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(container.Owner, out ActorComponent? actor))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(container.OwnerUid, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
var playerChannel = actor.PlayerSession.ConnectedClient;
|
||||
|
||||
@@ -79,13 +79,13 @@ namespace Content.Server.Radio.Components
|
||||
return Use(eventArgs.User);
|
||||
}
|
||||
|
||||
public bool CanListen(string message, EntityUidsource)
|
||||
public bool CanListen(string message, EntityUid source)
|
||||
{
|
||||
return RadioOn &&
|
||||
Owner.InRangeUnobstructed(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(source).Coordinates, range: ListenRange);
|
||||
}
|
||||
|
||||
public void Receive(string message, int channel, EntityUidspeaker)
|
||||
public void Receive(string message, int channel, EntityUid speaker)
|
||||
{
|
||||
if (RadioOn)
|
||||
{
|
||||
@@ -93,12 +93,12 @@ namespace Content.Server.Radio.Components
|
||||
}
|
||||
}
|
||||
|
||||
public void Listen(string message, EntityUidspeaker)
|
||||
public void Listen(string message, EntityUid speaker)
|
||||
{
|
||||
Broadcast(message, speaker);
|
||||
}
|
||||
|
||||
public void Broadcast(string message, EntityUidspeaker)
|
||||
public void Broadcast(string message, EntityUid speaker)
|
||||
{
|
||||
_radioSystem.SpreadMessage(this, speaker, message, BroadcastFrequency);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Radio.Components
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.GameObjects;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Radio.Components
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace Content.Server.Sandbox
|
||||
}
|
||||
}
|
||||
|
||||
void UpgradeId(EntityUidid)
|
||||
void UpgradeId(EntityUid id)
|
||||
{
|
||||
var accessSystem = EntitySystem.Get<AccessSystem>();
|
||||
accessSystem.TrySetTags(id, allAccess);
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (dockingFixture == null)
|
||||
{
|
||||
DebugTools.Assert(false);
|
||||
Logger.ErrorS("docking", $"Found null fixture on {((IComponent) body).Owner)}"
|
||||
Logger.ErrorS("docking", $"Found null fixture on {((IComponent) body).OwnerUid}");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (otherDockingFixture == null)
|
||||
{
|
||||
DebugTools.Assert(false);
|
||||
Logger.ErrorS("docking", $"Found null docking fixture on {ent)}"
|
||||
Logger.ErrorS("docking", $"Found null docking fixture on {ent}");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -200,8 +200,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>(((IComponent) dockA).Owner).GridID).GridEntityId;
|
||||
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner).GridID).GridEntityId;
|
||||
var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).OwnerUid).GridID).GridEntityId;
|
||||
var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).OwnerUid).GridID).GridEntityId;
|
||||
|
||||
var msg = new UndockEvent
|
||||
{
|
||||
@@ -211,8 +211,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
GridBUid = gridBUid,
|
||||
};
|
||||
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
||||
}
|
||||
|
||||
@@ -308,8 +308,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>(((IComponent) dockA).Owner);
|
||||
var dockBXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).Owner);
|
||||
var dockAXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockA).OwnerUid);
|
||||
var dockBXform = EntityManager.GetComponent<TransformComponent>(((IComponent) dockB).OwnerUid);
|
||||
|
||||
var gridA = _mapManager.GetGrid(dockAXform.GridID).GridEntityId;
|
||||
var gridB = _mapManager.GetGrid(dockBXform.GridID).GridEntityId;
|
||||
@@ -344,13 +344,13 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
dockA.DockJoint = joint;
|
||||
dockB.DockJoint = joint;
|
||||
|
||||
if (EntityManager.TryGetComponent(((IComponent) dockA).Owner, out ServerDoorComponent? doorA))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dockA).OwnerUid, out ServerDoorComponent? doorA))
|
||||
{
|
||||
doorA.ChangeAirtight = false;
|
||||
doorA.Open();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(((IComponent) dockB).Owner, out ServerDoorComponent? doorB))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dockB).OwnerUid, out ServerDoorComponent? doorB))
|
||||
{
|
||||
doorB.ChangeAirtight = false;
|
||||
doorB.Open();
|
||||
@@ -364,8 +364,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
GridBUid = gridB,
|
||||
};
|
||||
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).OwnerUid, msg, false);
|
||||
EntityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
||||
}
|
||||
|
||||
@@ -374,8 +374,8 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
/// </summary>
|
||||
private void TryDock(DockingComponent dockA, DockingComponent dockB)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(((IComponent) dockA).Owner, out PhysicsComponent? bodyA) ||
|
||||
!EntityManager.TryGetComponent(((IComponent) dockB).Owner, out PhysicsComponent? bodyB) ||
|
||||
if (!EntityManager.TryGetComponent(((IComponent) dockA).OwnerUid, out PhysicsComponent? bodyA) ||
|
||||
!EntityManager.TryGetComponent(((IComponent) dockB).OwnerUid, out PhysicsComponent? bodyB) ||
|
||||
!dockA.Enabled ||
|
||||
!dockB.Enabled)
|
||||
{
|
||||
@@ -425,13 +425,13 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
return;
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(((IComponent) dock).Owner, out ServerDoorComponent? doorA))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dock).OwnerUid, out ServerDoorComponent? doorA))
|
||||
{
|
||||
doorA.ChangeAirtight = true;
|
||||
doorA.Close();
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(((IComponent) dock.DockedWith).Owner, out ServerDoorComponent? doorB))
|
||||
if (EntityManager.TryGetComponent(((IComponent) dock.DockedWith).OwnerUid, out ServerDoorComponent? doorB))
|
||||
{
|
||||
doorB.ChangeAirtight = true;
|
||||
doorB.Close();
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
|
||||
private void OnGridInit(GridInitializeEvent ev)
|
||||
{
|
||||
ev.EntityUid).EnsureComponent<ShuttleComponent>(
|
||||
EntityManager.EnsureComponent<ShuttleComponent>(ev.EntityUid);
|
||||
}
|
||||
|
||||
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -71,7 +71,7 @@ namespace Content.Server.Singularity.Components
|
||||
Timer.SpawnRepeating(1000, () => { SharedEnergyPool--;}, _powerDecreaseCancellationTokenSource.Token);
|
||||
}
|
||||
|
||||
public bool CanRepell(EntityUidtoRepell)
|
||||
public bool CanRepell(EntityUid toRepell)
|
||||
{
|
||||
var powerNeeded = 1;
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerSingularityComponent?>(toRepell, out var singularityComponent))
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Content.Server.Singularity.Components
|
||||
private Tuple<Direction, ContainmentFieldConnection>? _connection1;
|
||||
private Tuple<Direction, ContainmentFieldConnection>? _connection2;
|
||||
|
||||
public bool CanRepell(EntityUidtoRepell) => _connection1?.Item2?.CanRepell(toRepell) == true ||
|
||||
public bool CanRepell(EntityUid toRepell) => _connection1?.Item2?.CanRepell(toRepell) == true ||
|
||||
_connection2?.Item2?.CanRepell(toRepell) == true;
|
||||
|
||||
public void OnAnchoredChanged()
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace Content.Server.Tabletop
|
||||
SpawnPiecesRow(session, entityManager, "White", new MapCoordinates(x, y - 7 * separation, mapId), separation);
|
||||
|
||||
// Extra queens
|
||||
EntityUidtempQualifier = entityManager.SpawnEntity("BlackQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 3 * separation, mapId));
|
||||
EntityUid tempQualifier = entityManager.SpawnEntity("BlackQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 3 * separation, mapId));
|
||||
session.Entities.Add(tempQualifier);
|
||||
EntityUidtempQualifier1 = entityManager.SpawnEntity("WhiteQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 4 * separation, mapId));
|
||||
EntityUid tempQualifier1 = entityManager.SpawnEntity("WhiteQueen", new MapCoordinates(x + 9 * separation + 9f / 32, y - 4 * separation, mapId));
|
||||
session.Entities.Add(tempQualifier1);
|
||||
}
|
||||
|
||||
@@ -53,23 +53,23 @@ namespace Content.Server.Tabletop
|
||||
switch (piecesRow[i])
|
||||
{
|
||||
case 'r':
|
||||
EntityUidtempQualifier = entityManager.SpawnEntity(color + "Rook", new MapCoordinates(x + i * separation, y, mapId));
|
||||
EntityUid tempQualifier = entityManager.SpawnEntity(color + "Rook", new MapCoordinates(x + i * separation, y, mapId));
|
||||
session.Entities.Add(tempQualifier);
|
||||
break;
|
||||
case 'n':
|
||||
EntityUidtempQualifier1 = entityManager.SpawnEntity(color + "Knight", new MapCoordinates(x + i * separation, y, mapId));
|
||||
EntityUid tempQualifier1 = entityManager.SpawnEntity(color + "Knight", new MapCoordinates(x + i * separation, y, mapId));
|
||||
session.Entities.Add(tempQualifier1);
|
||||
break;
|
||||
case 'b':
|
||||
EntityUidtempQualifier2 = entityManager.SpawnEntity(color + "Bishop", new MapCoordinates(x + i * separation, y, mapId));
|
||||
EntityUid tempQualifier2 = entityManager.SpawnEntity(color + "Bishop", new MapCoordinates(x + i * separation, y, mapId));
|
||||
session.Entities.Add(tempQualifier2);
|
||||
break;
|
||||
case 'q':
|
||||
EntityUidtempQualifier3 = entityManager.SpawnEntity(color + "Queen", new MapCoordinates(x + i * separation, y, mapId));
|
||||
EntityUid tempQualifier3 = entityManager.SpawnEntity(color + "Queen", new MapCoordinates(x + i * separation, y, mapId));
|
||||
session.Entities.Add(tempQualifier3);
|
||||
break;
|
||||
case 'k':
|
||||
EntityUidtempQualifier4 = entityManager.SpawnEntity(color + "King", new MapCoordinates(x + i * separation, y, mapId));
|
||||
EntityUid tempQualifier4 = entityManager.SpawnEntity(color + "King", new MapCoordinates(x + i * separation, y, mapId));
|
||||
session.Entities.Add(tempQualifier4);
|
||||
break;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace Content.Server.Tabletop
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
EntityUidtempQualifier = entityManager.SpawnEntity(color + "Pawn", new MapCoordinates(x + i * separation, y, mapId));
|
||||
EntityUid tempQualifier = entityManager.SpawnEntity(color + "Pawn", new MapCoordinates(x + i * separation, y, mapId));
|
||||
session.Entities.Add(tempQualifier);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,43 +35,43 @@ namespace Content.Server.Tabletop
|
||||
var center = session.Position;
|
||||
|
||||
// Red pieces.
|
||||
EntityUidtempQualifier = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y1));
|
||||
EntityUid tempQualifier = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y1));
|
||||
session.Entities.Add(tempQualifier);
|
||||
EntityUidtempQualifier1 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y2));
|
||||
EntityUid tempQualifier1 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y2));
|
||||
session.Entities.Add(tempQualifier1);
|
||||
EntityUidtempQualifier2 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y1));
|
||||
EntityUid tempQualifier2 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y1));
|
||||
session.Entities.Add(tempQualifier2);
|
||||
EntityUidtempQualifier3 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y2));
|
||||
EntityUid tempQualifier3 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y2));
|
||||
session.Entities.Add(tempQualifier3);
|
||||
|
||||
// Green pieces.
|
||||
EntityUidtempQualifier4 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y1));
|
||||
EntityUid tempQualifier4 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y1));
|
||||
session.Entities.Add(tempQualifier4);
|
||||
EntityUidtempQualifier5 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y2));
|
||||
EntityUid tempQualifier5 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y2));
|
||||
session.Entities.Add(tempQualifier5);
|
||||
EntityUidtempQualifier6 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y1));
|
||||
EntityUid tempQualifier6 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y1));
|
||||
session.Entities.Add(tempQualifier6);
|
||||
EntityUidtempQualifier7 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y2));
|
||||
EntityUid tempQualifier7 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y2));
|
||||
session.Entities.Add(tempQualifier7);
|
||||
|
||||
// Yellow pieces.
|
||||
EntityUidtempQualifier8 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y1));
|
||||
EntityUid tempQualifier8 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y1));
|
||||
session.Entities.Add(tempQualifier8);
|
||||
EntityUidtempQualifier9 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y2));
|
||||
EntityUid tempQualifier9 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y2));
|
||||
session.Entities.Add(tempQualifier9);
|
||||
EntityUidtempQualifier10 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y1));
|
||||
EntityUid tempQualifier10 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y1));
|
||||
session.Entities.Add(tempQualifier10);
|
||||
EntityUidtempQualifier11 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y2));
|
||||
EntityUid tempQualifier11 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y2));
|
||||
session.Entities.Add(tempQualifier11);
|
||||
|
||||
// Blue pieces.
|
||||
EntityUidtempQualifier12 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y1));
|
||||
EntityUid tempQualifier12 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y1));
|
||||
session.Entities.Add(tempQualifier12);
|
||||
EntityUidtempQualifier13 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y2));
|
||||
EntityUid tempQualifier13 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y2));
|
||||
session.Entities.Add(tempQualifier13);
|
||||
EntityUidtempQualifier14 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y1));
|
||||
EntityUid tempQualifier14 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y1));
|
||||
session.Entities.Add(tempQualifier14);
|
||||
EntityUidtempQualifier15 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y2));
|
||||
EntityUid tempQualifier15 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y2));
|
||||
session.Entities.Add(tempQualifier15);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,8 +133,8 @@ namespace Content.Server.UserInterface
|
||||
|
||||
public class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public EntityUid user { get; }
|
||||
public ActivatableUIOpenAttemptEvent(EntityUidwho)
|
||||
public EntityUid User { get; }
|
||||
public ActivatableUIOpenAttemptEvent(EntityUid who)
|
||||
{
|
||||
User = who;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
@@ -29,12 +29,12 @@ namespace Content.Server.Verbs.Commands
|
||||
var verbSystem = EntitySystem.Get<SharedVerbSystem>();
|
||||
|
||||
// get the 'player' entity (defaulting to command user, otherwise uses a uid)
|
||||
EntityUid playerEntity = null;
|
||||
EntityUid playerEntity = default;
|
||||
if (!int.TryParse(args[0], out var intPlayerUid))
|
||||
{
|
||||
if (args[0] == "self" && shell.Player?.AttachedEntity != null)
|
||||
{
|
||||
playerEntity = shell.Player.AttachedEntity;
|
||||
playerEntity = shell.Player.AttachedEntityUid.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -54,14 +54,14 @@ namespace Content.Server.Verbs.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (playerEntity == null)
|
||||
if (playerEntity == default)
|
||||
{
|
||||
shell.WriteError(Loc.GetString("invoke-verb-command-invalid-player-entity"));
|
||||
return;
|
||||
}
|
||||
|
||||
var entUid = new EntityUid(intUid);
|
||||
if (!entityManager.EntityExists(entUid)
|
||||
if (!entityManager.EntityExists(entUid))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("invoke-verb-command-invalid-target-entity"));
|
||||
return;
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
public void InsertMagazine(EntityUid user, EntityUidmagazine)
|
||||
public void InsertMagazine(EntityUid user, EntityUid magazine)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _soundMagInsert.GetSound(), Owner, AudioParams.Default.WithVolume(-2));
|
||||
Owner.PopupMessage(user, Loc.GetString("server-magazine-barrel-component-interact-using-success"));
|
||||
|
||||
Reference in New Issue
Block a user