alpathfinder 0.2.3 → 0.2.4
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 +2 -2
- package/alpathfinder_bg.js +26 -26
- package/alpathfinder_bg.wasm +0 -0
- package/package.json +1 -1
package/alpathfinder.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function canWalkPath(map_name: string, x1: number, y1: number, x2: number, y2: number): boolean;
|
|
4
3
|
export function prepare(g_js: any): void;
|
|
5
|
-
export function isWalkable(map_name: string, x_i: number, y_i: number): boolean;
|
|
6
4
|
export function getPath(map_from_name: string, x_from: number, y_from: number, map_to_name: string, x_to: number, y_to: number, speed?: number | null): any;
|
|
5
|
+
export function canWalkPath(map_name: string, x1: number, y1: number, x2: number, y2: number): boolean;
|
|
6
|
+
export function isWalkable(map_name: string, x_i: number, y_i: number): boolean;
|
package/alpathfinder_bg.js
CHANGED
|
@@ -185,6 +185,32 @@ 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
|
+
*/
|
|
191
|
+
export function prepare(g_js) {
|
|
192
|
+
wasm.prepare(g_js);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @param {string} map_from_name
|
|
197
|
+
* @param {number} x_from
|
|
198
|
+
* @param {number} y_from
|
|
199
|
+
* @param {string} map_to_name
|
|
200
|
+
* @param {number} x_to
|
|
201
|
+
* @param {number} y_to
|
|
202
|
+
* @param {number | null} [speed]
|
|
203
|
+
* @returns {any}
|
|
204
|
+
*/
|
|
205
|
+
export function getPath(map_from_name, x_from, y_from, map_to_name, x_to, y_to, speed) {
|
|
206
|
+
const ptr0 = passStringToWasm0(map_from_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
207
|
+
const len0 = WASM_VECTOR_LEN;
|
|
208
|
+
const ptr1 = passStringToWasm0(map_to_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
209
|
+
const len1 = WASM_VECTOR_LEN;
|
|
210
|
+
const ret = wasm.getPath(ptr0, len0, x_from, y_from, ptr1, len1, x_to, y_to, isLikeNone(speed) ? 0x100000001 : Math.fround(speed));
|
|
211
|
+
return ret;
|
|
212
|
+
}
|
|
213
|
+
|
|
188
214
|
/**
|
|
189
215
|
* @param {string} map_name
|
|
190
216
|
* @param {number} x1
|
|
@@ -200,13 +226,6 @@ export function canWalkPath(map_name, x1, y1, x2, y2) {
|
|
|
200
226
|
return ret !== 0;
|
|
201
227
|
}
|
|
202
228
|
|
|
203
|
-
/**
|
|
204
|
-
* @param {any} g_js
|
|
205
|
-
*/
|
|
206
|
-
export function prepare(g_js) {
|
|
207
|
-
wasm.prepare(g_js);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
229
|
/**
|
|
211
230
|
* @param {string} map_name
|
|
212
231
|
* @param {number} x_i
|
|
@@ -220,25 +239,6 @@ export function isWalkable(map_name, x_i, y_i) {
|
|
|
220
239
|
return ret !== 0;
|
|
221
240
|
}
|
|
222
241
|
|
|
223
|
-
/**
|
|
224
|
-
* @param {string} map_from_name
|
|
225
|
-
* @param {number} x_from
|
|
226
|
-
* @param {number} y_from
|
|
227
|
-
* @param {string} map_to_name
|
|
228
|
-
* @param {number} x_to
|
|
229
|
-
* @param {number} y_to
|
|
230
|
-
* @param {number | null} [speed]
|
|
231
|
-
* @returns {any}
|
|
232
|
-
*/
|
|
233
|
-
export function getPath(map_from_name, x_from, y_from, map_to_name, x_to, y_to, speed) {
|
|
234
|
-
const ptr0 = passStringToWasm0(map_from_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
235
|
-
const len0 = WASM_VECTOR_LEN;
|
|
236
|
-
const ptr1 = passStringToWasm0(map_to_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
237
|
-
const len1 = WASM_VECTOR_LEN;
|
|
238
|
-
const ret = wasm.getPath(ptr0, len0, x_from, y_from, ptr1, len1, x_to, y_to, isLikeNone(speed) ? 0x100000001 : Math.fround(speed));
|
|
239
|
-
return ret;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
242
|
export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
|
|
243
243
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
244
244
|
return ret;
|
package/alpathfinder_bg.wasm
CHANGED
|
Binary file
|