Inventories WiP

This commit is contained in:
PJB3005
2017-09-24 21:09:26 +02:00
parent 60ff292f14
commit f6e265bccb
7 changed files with 313 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using Content.Server.Interfaces.GameObjects;
using SS14.Shared.GameObjects;
using SS14.Shared.Interfaces.GameObjects;
using System;
namespace Content.Server.Interfaces.GameObjects
{
public class ItemComponent : Component, IItemComponent
{
public override string Name => "Item";
/// <inheritdoc />
public IInventorySlot ContainingSlot { get; private set; }
public void RemovedFromSlot()
{
if (ContainingSlot == null)
{
throw new InvalidOperationException("Item is not in a slot.");
}
ContainingSlot = null;
}
public void EquippedToSlot(IInventorySlot slot)
{
if (ContainingSlot != null)
{
throw new InvalidOperationException("Item is already in a slot.");
}
ContainingSlot = slot;
}
}
}