Scriptum/Documentation/Warehouse.md

44 lines
1005 B
Markdown
Raw Normal View History

2022-06-20 18:23:22 +02:00
# 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
```c#
BaseWarehouseController.Instance.OpenPanel();
```
### Close Panel
```c#
BaseWarehouseController.Instance.OpenPanel();
```
### Find Item
Check if class extending base warehouse structure has the item you are looking for
```c#
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`
```c#
BaseWarehouseController.Instance.RemoveItemFromPosition(int itemPosition);
```
Insteda of `BaseWarehouseController` you can use one of:
* `InventoryManager`
* `EquipmentManager`
* `ChestController`