alpathfinder 0.2.9 → 0.3.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.
package/alpathfinder.d.ts CHANGED
@@ -7,7 +7,7 @@ export interface PathNode {
7
7
  map: MapKey;
8
8
  x: number;
9
9
  y: number;
10
- method: "move" | "town" | "door" | "transport" | "enter" | "unknown";
10
+ method: "move" | "town" | "door" | "transport" | "enter" | "leave" | "unknown";
11
11
  spawn?: number;
12
12
  }
13
13
 
@@ -185,26 +185,16 @@ function getArrayU8FromWasm0(ptr, len) {
185
185
  ptr = ptr >>> 0;
186
186
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
187
187
  }
188
- /**
189
- * @param {any} g_js
190
- * @param {any | null} [exclude_maps]
191
- */
192
- export function prepare(g_js, exclude_maps) {
193
- wasm.prepare(g_js, isLikeNone(exclude_maps) ? 0 : addToExternrefTable0(exclude_maps));
194
- }
195
-
196
188
  /**
197
189
  * @param {string} map_name
198
- * @param {number} x1
199
- * @param {number} y1
200
- * @param {number} x2
201
- * @param {number} y2
190
+ * @param {number} x_i
191
+ * @param {number} y_i
202
192
  * @returns {boolean}
203
193
  */
204
- export function canWalkPath(map_name, x1, y1, x2, y2) {
194
+ export function isWalkable(map_name, x_i, y_i) {
205
195
  const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
206
196
  const len0 = WASM_VECTOR_LEN;
207
- const ret = wasm.canWalkPath(ptr0, len0, x1, y1, x2, y2);
197
+ const ret = wasm.isWalkable(ptr0, len0, x_i, y_i);
208
198
  return ret !== 0;
209
199
  }
210
200
 
@@ -227,16 +217,26 @@ export function getPath(map_from_name, x_from, y_from, map_to_name, x_to, y_to,
227
217
  return ret;
228
218
  }
229
219
 
220
+ /**
221
+ * @param {any} g_js
222
+ * @param {any | null} [exclude_maps]
223
+ */
224
+ export function prepare(g_js, exclude_maps) {
225
+ wasm.prepare(g_js, isLikeNone(exclude_maps) ? 0 : addToExternrefTable0(exclude_maps));
226
+ }
227
+
230
228
  /**
231
229
  * @param {string} map_name
232
- * @param {number} x_i
233
- * @param {number} y_i
230
+ * @param {number} x1
231
+ * @param {number} y1
232
+ * @param {number} x2
233
+ * @param {number} y2
234
234
  * @returns {boolean}
235
235
  */
236
- export function isWalkable(map_name, x_i, y_i) {
236
+ export function canWalkPath(map_name, x1, y1, x2, y2) {
237
237
  const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
238
  const len0 = WASM_VECTOR_LEN;
239
- const ret = wasm.isWalkable(ptr0, len0, x_i, y_i);
239
+ const ret = wasm.canWalkPath(ptr0, len0, x1, y1, x2, y2);
240
240
  return ret !== 0;
241
241
  }
242
242
 
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "collaborators": [
5
5
  "Kent Rasmussen <hyprkookeez@gmail.com>"
6
6
  ],
7
- "version": "0.2.9",
7
+ "version": "0.3.1",
8
8
  "files": [
9
9
  "alpathfinder_bg.wasm",
10
10
  "alpathfinder.js",