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