@eveshipfit/dogma-engine 13.2.0 → 13.3.0

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.
package/README.md CHANGED
@@ -32,6 +32,7 @@ import wasmInit, {
32
32
  save_eft,
33
33
  load_esi_fitting,
34
34
  save_esi_fitting,
35
+ post_load,
35
36
  load_killmail,
36
37
  load_link,
37
38
  calculate,
@@ -60,6 +61,8 @@ const eft = save_eft(fit);
60
61
  /* Or if you have a fitting a character saved in game, as ESI returns it (and the other way around): */
61
62
  const fromEsi = load_esi_fitting(fitting);
62
63
  const toEsi = save_esi_fitting(fit);
64
+ /* Neither EFT nor ESI has states; with the skills set, this sets the ones EVE gives an imported fit: */
65
+ const settled = post_load({ ...fromEsi, character: { skills } });
63
66
  /* Or if you have a killmail, as ESI returns it, for the fit of the ship that died: */
64
67
  const fromKillmail = load_killmail(killmail);
65
68
  /* Or if you have an EVEShip.fit link, `<version>:<payload>`, with the payload gunzipped and unbase64'd: */
@@ -584,6 +584,12 @@ export function load_names(bytes: Uint8Array): number;
584
584
  */
585
585
  export function load_sde(bytes: Uint8Array): number;
586
586
 
587
+ /**
588
+ * Set a fit loaded from EFT or an ESI fitting to the states EVE gives it on
589
+ * import. Set the skills of the character first.
590
+ */
591
+ export function post_load(fit: Fit): Fit;
592
+
587
593
  /**
588
594
  * Write a fit as EFT, the text format EVE copies a fit to the clipboard in.
589
595
  */
@@ -620,6 +626,7 @@ export interface InitOutput {
620
626
  readonly load_link: (a: number, b: number, c: number, d: number) => [number, number, number];
621
627
  readonly load_names: (a: number, b: number) => [number, number, number];
622
628
  readonly load_sde: (a: number, b: number) => [number, number, number];
629
+ readonly post_load: (a: any) => [number, number, number];
623
630
  readonly save_eft: (a: any) => [number, number, number, number];
624
631
  readonly save_esf: (a: any) => [number, number, number, number];
625
632
  readonly save_esf_link: (a: any) => [number, number, number, number];
@@ -151,6 +151,20 @@ export function load_sde(bytes) {
151
151
  return ret[0];
152
152
  }
153
153
 
154
+ /**
155
+ * Set a fit loaded from EFT or an ESI fitting to the states EVE gives it on
156
+ * import. Set the skills of the character first.
157
+ * @param {Fit} fit
158
+ * @returns {Fit}
159
+ */
160
+ export function post_load(fit) {
161
+ const ret = wasm.post_load(fit);
162
+ if (ret[2]) {
163
+ throw takeFromExternrefTable0(ret[1]);
164
+ }
165
+ return takeFromExternrefTable0(ret[0]);
166
+ }
167
+
154
168
  /**
155
169
  * Write a fit as EFT, the text format EVE copies a fit to the clipboard in.
156
170
  * @param {Fit} fit
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "EVEShipFit Team <info@eveship.fit>"
6
6
  ],
7
7
  "description": "Library to calculate statistics for EVE Online ship fits",
8
- "version": "13.2.0",
8
+ "version": "13.3.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",