using SS14.Server.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects; using System; namespace Content.Server.Interfaces.GameObjects { public interface IInventoryComponent : IComponent { /// /// Gets the item in the specified slot. /// /// The slot to get the item for. /// Null if the slot is empty, otherwise the item. IItemComponent Get(string slot); /// /// Gets the slot with specified name. /// This gets the slot, NOT the item contained therein. /// /// The name of the slot to get. IInventorySlot GetSlot(string slot); /// /// Puts an item in a slot. /// /// /// This will fail if there is already an item in the specified slot. /// /// The slot to put the item in. /// The item to insert into the slot. /// True if the item was successfully inserted, false otherwise. bool PutInSlot(string slot, IItemComponent item); /// /// Drops the item in a slot. /// /// The slot to drop the item from. /// True if an item was dropped, false otherwise. bool DropSlot(string slot); /// /// Adds a new slot to this inventory component. /// /// The name of the slot to add. /// /// Thrown if the slot with specified name already exists. /// void AddSlot(string slot); /// /// Removes a slot from this inventory component. /// /// /// If the slot contains an item, the item is dropped. /// /// The name of the slot to remove. void RemoveSlot(string slot); /// /// /// /// /// bool HasSlot(string slot); } public interface IInventorySlot { /// /// The name of the slot. /// string Name { get; } /// /// The item contained in the slot, can be null. /// IItemComponent Item { get; } /// /// The component owning us. /// IInventoryComponent Owner { get; } } }