Add Classes model

This commit is contained in:
VAILLANT Jeremy
2021-05-14 18:46:25 +02:00
parent 68ecc54191
commit 32473b4e70
2 changed files with 126 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
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