Item void

This commit is contained in:
Rendo 2025-10-17 01:11:01 +05:00
commit fa6212400b
7 changed files with 43 additions and 29 deletions

View file

@ -0,0 +1,29 @@
extends Inventory
## Base class for simple storages with no differentiation.
class_name VoidInventory
## Tries to add an item into inventory. Returns not stored stack of item.
func add(stack : Stack, context: InventoryContext = null) -> Stack:
return null
## Returns if conditions of adding are met
func can_add(item : Item = null, context: InventoryContext = null) -> bool:
return true
## Tries to take first item. Returns null if no items in inventory
func pop() -> Stack:
return null
func peek() -> Stack:
return null
## Tries to take certain item from inventory. Returns null if no item found
func take(item : Item,amount: int) -> Stack:
return null
## Finds first entry of item. Returns -1 if no item found
func find(item : Item) -> int:
return -1