alpathfinder 0.2.9 → 0.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/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
 
@@ -229,17 +219,27 @@ export function getPath(map_from_name, x_from, y_from, map_to_name, x_to, y_to,
229
219
 
230
220
  /**
231
221
  * @param {string} map_name
232
- * @param {number} x_i
233
- * @param {number} y_i
222
+ * @param {number} x1
223
+ * @param {number} y1
224
+ * @param {number} x2
225
+ * @param {number} y2
234
226
  * @returns {boolean}
235
227
  */
236
- export function isWalkable(map_name, x_i, y_i) {
228
+ export function canWalkPath(map_name, x1, y1, x2, y2) {
237
229
  const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
230
  const len0 = WASM_VECTOR_LEN;
239
- const ret = wasm.isWalkable(ptr0, len0, x_i, y_i);
231
+ const ret = wasm.canWalkPath(ptr0, len0, x1, y1, x2, y2);
240
232
  return ret !== 0;
241
233
  }
242
234
 
235
+ /**
236
+ * @param {any} g_js
237
+ * @param {any | null} [exclude_maps]
238
+ */
239
+ export function prepare(g_js, exclude_maps) {
240
+ wasm.prepare(g_js, isLikeNone(exclude_maps) ? 0 : addToExternrefTable0(exclude_maps));
241
+ }
242
+
243
243
  export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
244
244
  const ret = Error(getStringFromWasm0(arg0, arg1));
245
245
  return ret;
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.0",
8
8
  "files": [
9
9
  "alpathfinder_bg.wasm",
10
10
  "alpathfinder.js",