2
0
Fork 0

Update to d62467bd0576361f07f803cffb3e436b5885e1f7

This commit is contained in:
JeremyStar™ 2024-05-10 15:47:20 +02:00
parent c427f69f02
commit c5176325bf
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -23,8 +23,19 @@ var singles: Array[CoreValidationSingle]
# +++ module +++
func _cleanup() -> void:
# Schemas
var schemas_remove_enty: Array[CoreValidationSchema] = []
for schema in schemas:
schemas_remove_enty.append(schema)
if !is_instance_valid(schema): continue
if !is_instance_valid(schema.parent):
logger.diag("Removing schema '" + schema.name + "'")
schema.queue_free()
for schema in schemas_remove_enty:
schemas.remove_at(schemas.find(schema))
# Singles
var singles_remove_enty: Array[CoreLoggerInstance] = []
var singles_remove_enty: Array[CoreValidationSingle] = []
for single in singles:
singles_remove_enty.append(single)
if !is_instance_valid(single): continue
@ -34,17 +45,6 @@ func _cleanup() -> void:
for single in singles_remove_enty:
singles.remove_at(singles.find(single))
# Schemas
var schemas_remove_enty: Array[CoreLoggerInstance] = []
for schema in schemas:
singles_remove_enty.append(schema)
if !is_instance_valid(schema): continue
if !is_instance_valid(schema.parent):
logger.diag("Removing schema '" + schema.name + "'")
schema.queue_free()
for schema in schemas_remove_enty:
schemas.remove_at(schemas.find(schema))
func _schedule() -> void:
# Singles
for single in singles:
@ -61,10 +61,12 @@ func _schedule() -> void:
# +++ data validation +++
## Returns a new [CoreValidationSingle]
func get_single(data, parent: Node) -> CoreValidationSingle:
singles.append(parent)
return CoreValidationSingle.new(core, data, parent)
var single: CoreValidationSingle = CoreValidationSingle.new(core, data, parent)
singles.append(single)
return single
## Returns a new [CoreValidationSchema]
func get_schema(schema: Dictionary, parent: Node) -> CoreValidationSchema:
schemas.append(parent)
return CoreValidationSchema.new(core, schema, parent)
func get_schema(schema_dict: Dictionary, parent: Node) -> CoreValidationSchema:
var schema: CoreValidationSchema = CoreValidationSchema.new(core, schema_dict, parent)
schemas.append(schema)
return schema