Basic inventory, item and storage
This commit is contained in:
parent
b0b659acd4
commit
66a623e568
11 changed files with 155 additions and 1 deletions
22
scripts/inventory/inventory.gd
Normal file
22
scripts/inventory/inventory.gd
Normal file
|
@ -0,0 +1,22 @@
|
|||
@abstract
|
||||
extends Resource
|
||||
|
||||
class_name Inventory
|
||||
|
||||
func _init() -> void:
|
||||
resource_local_to_scene = true
|
||||
|
||||
@abstract
|
||||
func add(item : Stack) -> Stack
|
||||
|
||||
@abstract
|
||||
func pop() -> Stack
|
||||
|
||||
@abstract
|
||||
func take(item : Item,amount: int) -> Stack
|
||||
|
||||
@abstract
|
||||
func find(item : Item) -> int
|
||||
|
||||
func has(item : Item) -> bool:
|
||||
return find(item) != -1
|
Loading…
Add table
Add a link
Reference in a new issue