Validation singles & schemas now have names
This commit is contained in:
parent
7ea7de55ff
commit
fee0bb3eb1
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue