-
Notifications
You must be signed in to change notification settings - Fork 0
TPInventoryPackage
Tomasz Piowczyk edited this page Sep 8, 2018
·
1 revision
Action OnUsed { get; set; }
Action OnFailUsed { get; set; }
Action OnMoved { get; set; }
Action OnFailMoved { get; set; }
Action OnEquipped { get; set; }
Action OnUnEquipped { get; set; }int ID { get; }
int Type { get; }
string Name { get; }
string Description { get; }
double Worth { get; }
int AmountStack { get; }
int MaxStack { get; }
float Weight { get; }
ITPModifier[] Modifiers { get; }bool Use();
bool Stack(int count = 1);int Type { get; }
TItem StoredItem { get; set; }
Action OnItemChanged { get; set; }
TItem SwitchItem(TItem item);
bool MoveItem(ITPItemSlot<TItem> targetSlot);
bool CanHoldItem(TItem item);
bool TypeMatch(TItem item);
bool HasItem();
bool IsFull();ITPInventory<TItemSlot, TEquipSlot, TItem>
where TItemSlot : ITPItemSlot
where TEquipSlot : ITPEquipSlot
where TItem : ITPItem
TItemSlot[] ItemSlots { get; }
TEquipSlot[] EquipSlots { get; }
bool IsFull { get; }
bool AddItem(TItem item);
bool HasEmptySlot(int type = 0);
bool HasItem(int itemID);abstract class TPInventory<TItemSlot, TEquipSlot, TItem> : ITPInventory<TItemSlot, TEquipSlot, TItem>
where TItemSlot : ITPItemSlot
where TEquipSlot : ITPEquipSlot
where TItem : ITPItem
protected Dictionary<int, TItem> Items { get; set; }
public int ItemCount { get {} }
public virtual bool IsFull { get {} }
public virtual int SlotCount { get {} }
public virtual int EmptySlotsCount { get {} }
/// Returns false if slot doesn't match item or item exist and can't be more stacked
public virtual bool AddItem(TItem item, ITPItemSlot<TItem> slot){}
public void SetItemSlots(TItemSlot[] slots){}
public void SetEquipSlots(TEquipSlot[] slots){}
public ITPItemSlot<TItem> FindAnySlot(Predicate<ITPItemSlot<TItem>> match){}
/// Finds first matches slot from ItemSlots (can return null)
public TItemSlot FindItemSlot(Predicate<ITPItemSlot<TItem>> match){}
/// Finds first matches slot from EquipSlots (can return null)
public TEquipSlot FindEquipSlot(Predicate<ITPItemSlot<TItem>> match){}