kakozuzo/Code/swb_shared/IInventory.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2024-10-30 19:01:58 +03:00
namespace SWB.Shared;
public interface IInventory
{
public NetList<GameObject> Items { get; set; }
public GameObject Active { get; set; }
public void Add( GameObject gameObject, bool makeActive = false );
public GameObject AddClone( GameObject gamePrefab, bool makeActive = true );
public bool Has( GameObject gameObject );
public void SetActive( GameObject gameObject );
public void SetActive( string name );
public void Clear();
2024-10-30 19:48:58 +03:00
public void Disarm();
2024-10-30 19:01:58 +03:00
}
public interface IInventoryItem : IValid
{
/// <summary>Inventory slot</summary>
public int Slot { get; set; }
/// <summary>Image that represent the item on the HUD</summary>
public string Icon { get; set; }
/// <summary>Name that represent the item on the HUD</summary>
public string DisplayName { get; set; }
/// <summary>Called on the GameObject that will be the new active one (Broadcast for networked gameObjects!)</summary>
public void OnCarryStart();
/// <summary>Called when the GameObject stops being the active one (Broadcast for networked gameObjects!)</summary>
public void OnCarryStop();
/// <summary>Can the GameObject be switched out</summary>
public bool CanCarryStop();
}