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:
@@ -560,5 +560,17 @@ namespace Content.Server.Inventory.Components
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TryGetSlot(Slots slot, [NotNullWhen(true)] out EntityUid? item)
|
||||
{
|
||||
if (_slotContainers.TryGetValue(slot, out var container))
|
||||
{
|
||||
item = container.ContainedEntity;
|
||||
return item != null;
|
||||
}
|
||||
|
||||
item = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user