alpathfinder 0.2.0 → 0.2.2
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 +3 -3
- package/alpathfinder_bg.js +31 -31
- 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 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;
|
|
4
|
+
export function canWalkPath(map_name: string, x1: number, y1: number, x2: number, y2: number): boolean;
|
|
3
5
|
export function prepare(g_js: any): void;
|
|
4
|
-
export function
|
|
5
|
-
export function can_walk_path(map_name: string, x1: number, y1: number, x2: number, y2: number): boolean;
|
|
6
|
-
export function get_path(map_from_name: string, x_from: number, y_from: number, map_to_name: string, x_to: number, y_to: number, speed?: number | null): any;
|
|
6
|
+
export function isWalkable(map_name: string, x_i: number, y_i: number): boolean;
|
package/alpathfinder_bg.js
CHANGED
|
@@ -186,23 +186,22 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
186
186
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
|
-
* @param {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
* @
|
|
197
|
-
* @param {number} x_i
|
|
198
|
-
* @param {number} y_i
|
|
199
|
-
* @returns {boolean}
|
|
189
|
+
* @param {string} map_from_name
|
|
190
|
+
* @param {number} x_from
|
|
191
|
+
* @param {number} y_from
|
|
192
|
+
* @param {string} map_to_name
|
|
193
|
+
* @param {number} x_to
|
|
194
|
+
* @param {number} y_to
|
|
195
|
+
* @param {number | null} [speed]
|
|
196
|
+
* @returns {any}
|
|
200
197
|
*/
|
|
201
|
-
export function
|
|
202
|
-
const ptr0 = passStringToWasm0(
|
|
198
|
+
export function getPath(map_from_name, x_from, y_from, map_to_name, x_to, y_to, speed) {
|
|
199
|
+
const ptr0 = passStringToWasm0(map_from_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
203
200
|
const len0 = WASM_VECTOR_LEN;
|
|
204
|
-
const
|
|
205
|
-
|
|
201
|
+
const ptr1 = passStringToWasm0(map_to_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
202
|
+
const len1 = WASM_VECTOR_LEN;
|
|
203
|
+
const ret = wasm.getPath(ptr0, len0, x_from, y_from, ptr1, len1, x_to, y_to, isLikeNone(speed) ? 0x100000001 : Math.fround(speed));
|
|
204
|
+
return ret;
|
|
206
205
|
}
|
|
207
206
|
|
|
208
207
|
/**
|
|
@@ -213,30 +212,31 @@ export function is_walkable(map_name, x_i, y_i) {
|
|
|
213
212
|
* @param {number} y2
|
|
214
213
|
* @returns {boolean}
|
|
215
214
|
*/
|
|
216
|
-
export function
|
|
215
|
+
export function canWalkPath(map_name, x1, y1, x2, y2) {
|
|
217
216
|
const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
218
217
|
const len0 = WASM_VECTOR_LEN;
|
|
219
|
-
const ret = wasm.
|
|
218
|
+
const ret = wasm.canWalkPath(ptr0, len0, x1, y1, x2, y2);
|
|
220
219
|
return ret !== 0;
|
|
221
220
|
}
|
|
222
221
|
|
|
223
222
|
/**
|
|
224
|
-
* @param {
|
|
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}
|
|
223
|
+
* @param {any} g_js
|
|
232
224
|
*/
|
|
233
|
-
export function
|
|
234
|
-
|
|
225
|
+
export function prepare(g_js) {
|
|
226
|
+
wasm.prepare(g_js);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @param {string} map_name
|
|
231
|
+
* @param {number} x_i
|
|
232
|
+
* @param {number} y_i
|
|
233
|
+
* @returns {boolean}
|
|
234
|
+
*/
|
|
235
|
+
export function isWalkable(map_name, x_i, y_i) {
|
|
236
|
+
const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
235
237
|
const len0 = WASM_VECTOR_LEN;
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
const ret = wasm.get_path(ptr0, len0, x_from, y_from, ptr1, len1, x_to, y_to, isLikeNone(speed) ? 0x100000001 : Math.fround(speed));
|
|
239
|
-
return ret;
|
|
238
|
+
const ret = wasm.isWalkable(ptr0, len0, x_i, y_i);
|
|
239
|
+
return ret !== 0;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
|
package/alpathfinder_bg.wasm
CHANGED
|
Binary file
|