-
Notifications
You must be signed in to change notification settings - Fork 44
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
Problem with the Game arrays #11
Comments
What kind of compile time error you're getting and what line calls it out? |
error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'
|
I was testing around a bit and I think you're right. If we only have array, then it should work in most cases, but your solution is better. I'll change the API. Thanks for your help. Although, I think you have a bug in your code. With using creeps.indexOf(). If I understand correctly then creeps is an object and not an array. So you can't use splice or indexOf() with it. |
Updated the API. Run npm install to get the updates. |
Thanks, I'm just learning Typescript. Chose to learn it by applying it to Screeps. |
Thanks for creating and keeping this updated.
I noticed issues compiling and I think I see the problem but I'm pretty new at this.
It's the declarations for Game.rooms/flags/creeps etc. Instead of just an array, shouldn't they be like this?
The text was updated successfully, but these errors were encountered: