Make ItemCabinet use ItemSlots (#4771)

* pda slot names

* cabinets use item slots

* fix yaml

* fix tests
This commit is contained in:
Leon Friedrich
2021-10-06 08:55:45 +11:00
committed by GitHub
parent d2748d1e59
commit 6f50dd2f7b
14 changed files with 164 additions and 277 deletions

View File

@@ -1,16 +1,11 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Content.Server.Cabinet;
using Content.Server.GameObjects.Components;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Whitelist;
using NUnit.Framework;
using NUnit.Framework.Internal;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager;
namespace Content.IntegrationTests.Tests.Utility
{
@@ -30,14 +25,16 @@ namespace Content.IntegrationTests.Tests.Utility
- type: entity
id: WhitelistDummy
components:
- type: ItemCabinet
whitelist:
prototypes:
- ValidPrototypeDummy
components:
- {ValidComponent}
tags:
- ValidTag
- type: ItemSlots
slots:
slotName:
whitelist:
prototypes:
- ValidPrototypeDummy
components:
- {ValidComponent}
tags:
- ValidTag
- type: entity
id: InvalidComponentDummy
@@ -102,7 +99,7 @@ namespace Content.IntegrationTests.Tests.Utility
// Test from serialized
var dummy = entityManager.SpawnEntity("WhitelistDummy", mapCoordinates);
var whitelistSer = dummy.GetComponent<ItemCabinetComponent>().Whitelist;
var whitelistSer = dummy.GetComponent<SharedItemSlotsComponent>().Slots.Values.First().Whitelist;
Assert.That(whitelistSer, Is.Not.Null);
Assert.That(whitelistSer.Components, Is.Not.Null);