game-data-gen 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +14 -0
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -82,6 +82,20 @@ for (const block of blocks) {
82
82
  break;
83
83
  }
84
84
  }
85
+ for (const field of fields) {
86
+ const [fieldName, fieldType] = field.split(" ");
87
+ switch (fieldType) {
88
+ case "string" /* STRING */:
89
+ case "boolean" /* BOOLEAN */:
90
+ case "number" /* NUMBER */:
91
+ output.push("");
92
+ output.push(`/** Set the value of the ${fieldName} field within the ${name} ${getTypeName(type)}. */`);
93
+ output.push(`export function set${capitalize(fieldName)}(value: ${fieldType}) {`);
94
+ output.push(` ${fieldName} = value`);
95
+ output.push("}");
96
+ break;
97
+ }
98
+ }
85
99
  if (type === "soa" /* SOA */) {
86
100
  output.push("");
87
101
  output.push(`/** Zero an index within the ${name} ${getTypeName(type)}. */`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "game-data-gen",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"