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,9 +5,11 @@ const SCHEMA_VERSION := 1
|
||||
|
||||
var data: Dictionary
|
||||
|
||||
|
||||
func _init(record_data: Dictionary = {}) -> void:
|
||||
data = record_data.duplicate(true)
|
||||
|
||||
|
||||
static func create(
|
||||
event_id: int,
|
||||
event_type: StringName,
|
||||
@@ -18,25 +20,36 @@ static func create(
|
||||
item_id: StringName,
|
||||
amount: float
|
||||
) -> EconomicEventRecord:
|
||||
return EconomicEventRecord.new({
|
||||
"schema_version": SCHEMA_VERSION,
|
||||
"event_id": event_id,
|
||||
"event_type": String(event_type),
|
||||
"tick": tick,
|
||||
"actor_id": actor_id,
|
||||
"source_id": String(source_id),
|
||||
"destination_id": String(destination_id),
|
||||
"item_id": String(item_id),
|
||||
"amount": amount
|
||||
})
|
||||
return EconomicEventRecord.new(
|
||||
{
|
||||
"schema_version": SCHEMA_VERSION,
|
||||
"event_id": event_id,
|
||||
"event_type": String(event_type),
|
||||
"tick": tick,
|
||||
"actor_id": actor_id,
|
||||
"source_id": String(source_id),
|
||||
"destination_id": String(destination_id),
|
||||
"item_id": String(item_id),
|
||||
"amount": amount
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
static func from_dictionary(record_data: Dictionary) -> EconomicEventRecord:
|
||||
if int(record_data.get("schema_version", -1)) != SCHEMA_VERSION:
|
||||
return null
|
||||
if not record_data.has_all([
|
||||
"event_id", "event_type", "tick", "actor_id", "source_id",
|
||||
"destination_id", "item_id", "amount"
|
||||
]):
|
||||
if not record_data.has_all(
|
||||
[
|
||||
"event_id",
|
||||
"event_type",
|
||||
"tick",
|
||||
"actor_id",
|
||||
"source_id",
|
||||
"destination_id",
|
||||
"item_id",
|
||||
"amount"
|
||||
]
|
||||
):
|
||||
return null
|
||||
var normalized := record_data.duplicate(true)
|
||||
normalized["schema_version"] = SCHEMA_VERSION
|
||||
@@ -60,5 +73,6 @@ static func from_dictionary(record_data: Dictionary) -> EconomicEventRecord:
|
||||
return null
|
||||
return EconomicEventRecord.new(normalized)
|
||||
|
||||
|
||||
func to_dictionary() -> Dictionary:
|
||||
return data.duplicate(true)
|
||||
|
||||
Reference in New Issue
Block a user