Interface ColonyInventory


public interface ColonyInventory
Access to physical settlement stockpiles and placed storage containers. Every method requires the owning callback thread and expires with its context. Actor inventories, loot, carts and abstract overflow stores are outside this interface.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Detached physical inventory, safe to retain after the callback.
  • Method Summary

    Modifier and Type
    Method
    Description
    Looks up a concrete store without creating an inventory or exposing a mutable manager.
    Lists concrete storage keys, including empty storage.
    boolean
    transfer(String source, String destination, String resourceId, int amount)
    Immediately transfers an exact quantity between two concrete stores.
  • Method Details

    • stores

      List<String> stores()
      Lists concrete storage keys, including empty storage. This is a category scan; retain the detached result and prefer direct lookups during a callback.
      Returns:
      immutable storage keys with positive physical capacity, in lexical order
      Throws:
      IllegalStateException - outside the owning callback or thread
    • stock

      Looks up a concrete store without creating an inventory or exposing a mutable manager.
      Parameters:
      key - opaque key returned by stores(); null or blank has no match
      Returns:
      detached contents and physical capacity, or null for a missing/ineligible store
      Throws:
      IllegalStateException - outside the owning callback or thread
    • transfer

      boolean transfer(String source, String destination, String resourceId, int amount)
      Immediately transfers an exact quantity between two concrete stores. This is a scripted inventory operation, not a hauling order. Filters, aggregate stack-size capacity, and integer overflow are checked before mutation; stack metadata and age buckets are preserved. Capacity estimation does not distinguish individual copies' metadata. A rejected transfer changes neither store.
      Parameters:
      source - existing source key
      destination - existing destination key, distinct from source
      resourceId - registered resource identity
      amount - quantity from 1 through 4096
      Returns:
      whether the full quantity moved
      Throws:
      IllegalArgumentException - if amount is outside its bounds
      IllegalStateException - outside the callback/thread or after its shared 128-command budget