Scriptum/Documentation/Warehouse.md
2022-06-20 18:45:26 +02:00

1005 B

Warehouse

It's the core mechanism on which the entire set of panels available in the game is working.

On the basis of it work modules such as:

  • Inventory
  • Equippment
  • Chest system

API

Open Panel

BaseWarehouseController.Instance.OpenPanel();

Close Panel

BaseWarehouseController.Instance.OpenPanel();

Find Item

Check if class extending base warehouse structure has the item you are looking for

var questItem = InventoryManager.Instance.FindItemInWarehouse("lumberjack axe");

if(!questItem.Equals(new KeyValuePair<int, Item>()))
{
    // TODO code if item has been found
} else {
    // TODO code if item was not found
}

Remove Item

To delete the item, pass its position in the warehouse. You can use result of function above questItem.Key

BaseWarehouseController.Instance.RemoveItemFromPosition(int itemPosition);

Insteda of BaseWarehouseController you can use one of:

  • InventoryManager
  • EquipmentManager
  • ChestController