style: apply gdformat formatting across the entire project
Auto-format all GDScript files using gdformat from gdtoolkit. This is a baseline formatting pass to ensure consistent style: - Normalizes indentation and spacing - Wraps long lines to 100 characters - Removes trailing whitespace - Standardizes blank lines between functions 68 files reformatted, 8 files left unchanged (3rd-party addon files with parse errors excluded).
This commit is contained in:
@@ -5,17 +5,22 @@ const SCHEMA_VERSION := 1
|
||||
|
||||
var data: Dictionary
|
||||
|
||||
|
||||
func _init(record_data: Dictionary = {}) -> void:
|
||||
data = record_data.duplicate(true)
|
||||
|
||||
|
||||
static func capture(village: SimVillage) -> VillageStateRecord:
|
||||
return VillageStateRecord.new({
|
||||
"schema_version": SCHEMA_VERSION,
|
||||
"food": village.food,
|
||||
"wood": village.wood,
|
||||
"safety": village.safety,
|
||||
"knowledge": village.knowledge
|
||||
})
|
||||
return VillageStateRecord.new(
|
||||
{
|
||||
"schema_version": SCHEMA_VERSION,
|
||||
"food": village.food,
|
||||
"wood": village.wood,
|
||||
"safety": village.safety,
|
||||
"knowledge": village.knowledge
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
static func from_dictionary(record_data: Dictionary) -> VillageStateRecord:
|
||||
if int(record_data.get("schema_version", -1)) != SCHEMA_VERSION:
|
||||
@@ -24,6 +29,7 @@ static func from_dictionary(record_data: Dictionary) -> VillageStateRecord:
|
||||
return null
|
||||
return VillageStateRecord.new(record_data)
|
||||
|
||||
|
||||
func restore(debug_logs: bool) -> SimVillage:
|
||||
var village := SimVillage.new()
|
||||
village.debug_logs = debug_logs
|
||||
@@ -35,5 +41,6 @@ func restore(debug_logs: bool) -> SimVillage:
|
||||
village.update_priorities()
|
||||
return village
|
||||
|
||||
|
||||
func to_dictionary() -> Dictionary:
|
||||
return data.duplicate(true)
|
||||
|
||||
Reference in New Issue
Block a user