Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathfinder / as_ref() #8

Merged
merged 4 commits into from
Mar 24, 2024
Merged

Conversation

wtfrank
Copy link
Contributor

@wtfrank wtfrank commented Mar 20, 2024

search_path originally had &Object arguments. I've changed these to &JsArray which is what the rust world api uses for the equivalent function.

Creep can convert to &JsArray via as_ref() but not to Object.

I don't know if it's possible to give Creep an AsRef trait (new to wasm_bindgen) but I've been able to do pathfinding with this change.

@wtfrank wtfrank changed the title Pathfinder as ref Pathfinder / as_ref() Mar 20, 2024
wtfrank added 2 commits March 20, 2024 21:48
Creep and other types can convert to JsArray via as_ref() but not Object
@wtfrank wtfrank force-pushed the pathfinder_as_ref branch from 3d491ab to 8915d18 Compare March 20, 2024 21:51
@shanemadden shanemadden merged commit f225811 into rustyscreeps:main Mar 24, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants