Move Access & AccessReader to shared. (#5798)
* git mv * Move Access Component & system. - Name space changes - Rename AccessReader to AccessReaderComponent - Also need an abstract TryGetSlot function for SharedInventoryComponent * better TryGetSlot * Ah yes, tests exist.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Access.Components;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Shared.Access.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
@@ -32,8 +32,8 @@ namespace Content.Server.AI.Pathfinding
|
||||
/// The entities on this tile that require access to traverse
|
||||
/// </summary>
|
||||
/// We don't store the ICollection, at least for now, as we'd need to replicate the access code here
|
||||
public IReadOnlyCollection<AccessReader> AccessReaders => _accessReaders.Values;
|
||||
private readonly Dictionary<EntityUid, AccessReader> _accessReaders = new(0);
|
||||
public IReadOnlyCollection<AccessReaderComponent> AccessReaders => _accessReaders.Values;
|
||||
private readonly Dictionary<EntityUid, AccessReaderComponent> _accessReaders = new(0);
|
||||
|
||||
public PathfindingNode(PathfindingChunk parent, TileRef tileRef)
|
||||
{
|
||||
@@ -268,7 +268,7 @@ namespace Content.Server.AI.Pathfinding
|
||||
// TODO: Check for powered I think (also need an event for when it's depowered
|
||||
// AccessReader calls this whenever opening / closing but it can seem to get called multiple times
|
||||
// Which may or may not be intended?
|
||||
if (entMan.TryGetComponent(entity, out AccessReader? accessReader) && !_accessReaders.ContainsKey(entity))
|
||||
if (entMan.TryGetComponent(entity, out AccessReaderComponent? accessReader) && !_accessReaders.ContainsKey(entity))
|
||||
{
|
||||
_accessReaders.Add(entity, accessReader);
|
||||
ParentChunk.Dirty();
|
||||
|
||||
Reference in New Issue
Block a user