Some things looks strange to me with the store refactoring, is that intentional:
getCapacitywith a not valid resource returns
null, while using
getUsedCapacitywith the same resource returns
extension.store.getCapacity("power") // => null extension.store.getUsedCapacity("power") // => 0
It seems inconsistent to me, maybe it should be aligned on one or the other behavior (I personally think returning
0in both cases makes more sense, but the spec/doc seems to expect
nullin both cases).
getCapacityon tombstones returns
null(I guess it is the same for ruins).
I think there is actually no limit, so returning
Infinitywould make more sense and be more useful.
For example, having this behavior looks inconsistent to me:
tombstone.store.getUsedCapacity("energy") // => 500 tombstone.store.getCapacity("energy") // => null (even though there is actually some energy in the tombstone...)
Note that mostly, the issue is that when getting
null, we don't know if the store does not accept this resource at all, or if the limit is actually infinity. So if my first point is taken into account so that
0when the store does not accept the resource, then it would be kind of ok to keep