51 lines
1.9 KiB
C#
51 lines
1.9 KiB
C#
using SS14.Shared.Interfaces.GameObjects;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Content.Server.Interfaces.GameObjects
|
|
{
|
|
public interface IHandsComponent : IComponent
|
|
{
|
|
/// <summary>
|
|
/// The hand index of the currently active hand.
|
|
/// </summary>
|
|
string ActiveIndex { get; }
|
|
|
|
/// <summary>
|
|
/// Enumerates over every held item.
|
|
/// </summary>
|
|
IEnumerable<IItemComponent> GetAllHands();
|
|
|
|
/// <summary>
|
|
/// Gets the item held by a hand.
|
|
/// </summary>
|
|
/// <param name="index">The index of the hand to get.</param>
|
|
/// <returns>The item in the held, null if no item is held</returns>
|
|
IItemComponent GetHand(string index);
|
|
|
|
/// <summary>
|
|
/// Puts an item into any empty hand, preferring the active hand.
|
|
/// </summary>
|
|
/// <param name="item">The item to put in a hand.</param>
|
|
/// <returns>True if the item was inserted, false otherwise.</returns>
|
|
bool PutInHand(IItemComponent item);
|
|
|
|
/// <summary>
|
|
/// Puts an item into a specific hand.
|
|
/// </summary>
|
|
/// <param name="item">The item to put in the hand.</param>
|
|
/// <param name="index">The index of the hand to put the item into.</param>
|
|
/// <param name="fallback">
|
|
/// If true and the provided hand is full, the method will fall back to <see cref="PutInHand(IItemComponent)" />
|
|
/// </param>
|
|
/// <returns>True if the item was inserted into a hand, false otherwise.</returns>
|
|
bool PutInHand(IItemComponent item, string index, bool fallback=true);
|
|
|
|
/// <summary>
|
|
/// Drops an item on the ground, removing it from the hand.
|
|
/// </summary>
|
|
/// <param name="index">The hand to drop from.</param>
|
|
/// <returns>True if an item was successfully dropped, false otherwise.</returns>
|
|
bool Drop(string index);
|
|
}
|
|
}
|