mirror of
https://port.numenaute.org/aleajactaest/khanat-client.git
synced 2024-12-19 07:58:43 +00:00
18 lines
569 B
GDScript
18 lines
569 B
GDScript
extends Node
|
|
class_name Inventory
|
|
|
|
var items = []
|
|
|
|
func from_dict( datas ):
|
|
|
|
for item in datas:
|
|
var extension = item.get_extension()
|
|
|
|
if extension == "equippable":
|
|
var new_item = Equippable.new()
|
|
var file = File.new()
|
|
if file.open( "res://ressources/files/items/equippables/" + item, File.READ) == OK:
|
|
var json = JSON.parse( file.get_as_text() )
|
|
if json.result:
|
|
new_item.from_dict( json.result )
|
|
self.items.push_back( new_item )
|