-
Notifications
You must be signed in to change notification settings - Fork 45
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
Implement Rust traits for Screeps types #2
Comments
In general, agreed! Were there any specific Screeps types you were thinking Index/IndexMut would be appropriate for? |
I was specifically thinking the dict types (creeps, spawns, memory) should have Index/IndexMut, and probably also be iterable? |
Alright- that makes sense. The current design of the Game.* dicts could be redone so they support implementing traits. Right now they're modules, but we could make them structs with no fields. It could then implement The main problem I see with implementing For memory, the main question I have is what type the index should result in. I went with methods for each specific type in order to have checked/typed access. Do you think introducing a Even here though, there's still the problem with references. Rust's |
Things like
Index
,IndexMut
, etc. should be implemented for better integration with Rust codeThe text was updated successfully, but these errors were encountered: