ResourceInventory
classSingle slot inventory holding one resource item
Fields
| Name | Type | Description |
|---|---|---|
| item | StaticItem | |
| drain | integer | |
| capacity | integer |
Functions
ResourceInventory:add_resource(amount)
Put resource into the slot ignoring transfer rules
| amount | integer |
Standard members (4)
Generated for every class of this kind by the game's codegen, not written for ResourceInventory.
| ResourceInventory.cast(object) | Trying to cast Object into ResourceInventory |
| ResourceInventory.get_class() | Return ResourceInventory class object |
| ResourceInventory.new(parent, name) | Creates a new ResourceInventory instance |
| ResourceInventory.new_simple() | Creates a new ResourceInventory instance |
Inherited from SingleSlotInventory (1)
- SingleSlotInventory:set_simple_filter(item) Accept only the given item in this slot
Inherited from InventoryAccess (4)
- zero_slots
- draggable Whether inventory can be dragged in UI (default: true)
- InventoryAccess:add(item, count) Add item with count to InventoryAccess
- InventoryAccess:sub(item, count) Remove item with count from InventoryAccess
Inherited from InventoryReader (3)
- size Number of slots in this InventoryReader
- InventoryReader:get(index) Get ItemData with index from InventoryReader
- InventoryReader:find(item) Looking for index of StaticItem in InventoryReader
Inherited from Instance (1)
- Instance:is_valid() Returns false once the underlying engine object has been destroyed
Inherited from Object (3)
- name Object name
- Object.find(name) Find an already loaded object by name
- Object:get_class() Class of this object