Files
puzzle-quest/db/MBase.gd
T

25 lines
618 B
GDScript
Raw Normal View History

2021-05-14 18:46:25 +02:00
extends Object
var table = null
func _get_data(datas, index):
return datas[index].get_data()
func _set_data(value, id, type):
table.edit_data(id, type, String(value))
Global.database.save_db()
return value
func _get_data_id(prop_name, index):
print("[mbase#_get_data_id] : prop_name : "+String(prop_name))
print("[mbase#_get_data_id] : index : "+String(index))
if table.get_prop_at(index).get_prop_name() == prop_name:
print("[mbase#_get_data_id] : find prop with ID ")
var id = table.get_prop_at(index).get_prop_id()
print("[mbase#_get_data_id] : "+String(id))
return id
else:
return null