Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. Mwaahahahaha
    3. Posts
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Posts made by Mwaahahahaha

    • RE: Factories, new resources, NPC Strongholds

      Some things looks strange to me with the store refactoring, is that intentional:

      • Using getCapacity with a not valid resource returns null, while using getUsedCapacity with the same resource returns 0.

        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 0 in both cases makes more sense, but the spec/doc seems to expect null in both cases).

      • Using getCapacity on tombstones returns null (I guess it is the same for ruins).
        I think there is actually no limit, so returning Number.MAX_SAFE_INTEGER or Infinity would 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 getCapacity returns 0 when the store does not accept the resource, then it would be kind of ok to keep null for infinity...

      posted in News & Announcements
      Mwaahahahaha