class GodotFileEntry {
entryType;
attributes;
properties;
constructor(entryType, attributes, properties) {
this.entryType = entryType;
this.attributes = attributes;
this.properties = properties;
}
get id() {
return this.attributes.get("id").value;
}
serialize() {
const serializedHeadingParts = [this.entryType];
for (const [key, value] of this.attributes) {
serializedHeadingParts.push(`${key}=${value.serialize()}`);
}
const serializedHeading = `[${serializedHeadingParts.join(" ")}]`;
const serializedProperties = [];
for (const [key, value] of this.properties) {
serializedProperties.push(`${key} = ${value.serialize()}`);
}
return [serializedHeading].concat(serializedProperties).join("\n");
}
}