exaV / screeps-kotlin-types

Screep's Kotlin type definitions
MIT License
17 stars 18 forks source link

"Factories, new resources, NPC Strongholds" update support #48

Closed truekabal closed 4 years ago

truekabal commented 4 years ago

New Store interface has some interesting features. For now all entities, which had energy, power or any other resource in their entity variable, implement Store instead.

If getCapacity(), getFreeCapacity(), getUsedCapacity() is called by entity which can contain any resource (creep, Storage, Terminal, Container) - overall capacity will be returned. But!! getCapacity() and other methods which would be called by for example Link or Spawn will return null, because you need to set the exact ResourceConstant _(getCapacity(RESOURCEENERGY)) for getting max capacity for that resource

Assuming that I'd be glad if someone improve Store interface for all possible variants of usage

magnusesp commented 4 years ago

I've added you to the #kotlin channel on the Screeps Slack

truekabal commented 4 years ago

Pushed code review fixes. Also fixed Ruin and Tombstore errors.

I decided to rename IStore to StoreOwner and StoreDefinition to Store. As for me this names show exact definition of interface

exaV commented 4 years ago

Thanks @truekabal. I like the new names a lot better :) I will check why the build is not working

exaV commented 4 years ago

Thanks!