Item void
This commit is contained in:
parent
788e42135f
commit
fa6212400b
7 changed files with 43 additions and 29 deletions
29
scripts/inventory/void_inventory.gd
Normal file
29
scripts/inventory/void_inventory.gd
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue