rustyscreeps / screeps-game-api

Typed bindings to the Screeps in-game API for WASM Rust AIs
MIT License
138 stars 44 forks source link

Screeps 4.x store changes #253

Closed shanemadden closed 4 years ago

shanemadden commented 4 years ago

Screeps 4.0 deprecates Creep.carry and the non-.store storage attributes on a number of structures. CanStoreEnergy should be removed and all of these structures (and possibly also creeps?) should be added to HasStore (removing ghodium()/ghodium_capacity() from nukers, mineral_amount() from labs etc) to move off of the deprecated properties.

daboross commented 4 years ago

Sounds good!

I think we'll also want some methods to match Store.getCapacity(Resource) and getFreeCapacity / getUsedCapacity, since those are new and replace the specific methods like ghodium_capacity.

Another design question, though: what do we want to do with the Store type? We could:

I'm inclined towards the last option, but any of these or any others could be good?

ASalvail commented 4 years ago

They added a prototype in order to make a unified interface. It feels a lot like a trait already, so my vote goes to sticking everything in HasStore.