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:
Leon Friedrich
2021-12-26 17:07:28 +13:00
committed by GitHub
parent 32d752bfa6
commit b675bdb789
27 changed files with 90 additions and 81 deletions

View File

@@ -228,9 +228,17 @@ namespace Content.Client.Inventory
_playerAttached = true;
}
public bool TryGetSlot(Slots slot, [NotNullWhen(true)] out EntityUid item)
public override bool TryGetSlot(Slots slot, [NotNullWhen(true)] out EntityUid? item)
{
return _slots.TryGetValue(slot, out item);
// dict TryGetValue uses default EntityUid, not null.
if (!_slots.ContainsKey(slot))
{
item = null;
return false;
}
item = _slots[slot];
return item != null;
}
public bool TryFindItemSlots(EntityUid item, [NotNullWhen(true)] out Slots? slots)