Validation singles & schemas now have names

This commit is contained in:
JeremyStar™ 2024-05-15 01:57:53 +02:00
parent 7ea7de55ff
commit fee0bb3eb1
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -62,17 +62,20 @@ func _schedule() -> void:
## Returns a new [CoreValidationSingle].
func get_single(data, parent: Node) -> CoreValidationSingle:
var single: CoreValidationSingle = CoreValidationSingle.new(core, data, parent)
single.name = core.stringify_variables("CoreValidationSingle -> %parent% (type=%type% bytes=%bytes%)", { "parent": parent, "type": type_string(typeof(data)), "bytes": var_to_bytes_with_objects(data).size() })
singles.append(single)
return single
## Returns a new [CoreValidationSingle] for use in [CoreValidationSchema]s.
func get_single_schema(parent: Node) -> CoreValidationSingle:
var single: CoreValidationSingle = CoreValidationSingle.new(core, null, parent)
single.name = core.stringify_variables("CoreValidationSingle -> %parent% (no data, for schema)", { "parent": parent })
singles.append(single)
return single
## Returns a new [CoreValidationSchema].
func get_schema(schema_new: Dictionary, data_new: Dictionary, parent: Node) -> CoreValidationSchema:
var schema: CoreValidationSchema = CoreValidationSchema.new(core, schema_new, data_new, parent)
schema.name = core.stringify_variables("CoreValidationSchema -> %parent% (keys_schema=%keys_schema% keys_data=%keys_data% bytes_schema=%bytes_schema% bytes_data=%bytes_data%)", { "parent": parent, "keys_schema": schema_new.size(), "keys_data": data_new.size(), "bytes_schema": var_to_bytes_with_objects(schema_new).size(), "bytes_data": var_to_bytes_with_objects(data_new).size() })
schemas.append(schema)
return schema