Saxonberg Server API
    Preparing search index...

    Public shape provided by ContainerMixin.

    The optional Witness methods (canAddContainable, canRemoveContainable, onContainableAdded, onContainableRemoved) fire from ContainmentApi.move. Implement only the ones you care about; absence is treated as "no opinion."

    interface Container {
        addContainable(item: Stuff & Containable): void;
        canAddContainable?(thing: Stuff & Containable): VetoResult;
        canRemoveContainable?(thing: Stuff & Containable): VetoResult;
        getContents(): (Stuff & Containable)[];
        getDeepContents(): (Stuff & Containable)[];
        hasContainable(item: Stuff & Containable): boolean;
        onContainableAdded?(thing: Stuff & Containable): void;
        onContainableRemoved?(thing: Stuff & Containable): void;
        removeContainable(item: Stuff & Containable): boolean;
    }
    Index

    Methods

    • Recursive contents: every Containable reachable from this Container, including descendants of nested Containers. Walked depth-first pre-order, so a child appears immediately after its parent. Containment is acyclic by construction (a Container can't contain its own ancestor — Containable.setContainer enforces it), so no cycle protection is needed.

      Used by MQL's :I deep-inventory transform; equally available to controllers that want every nested item without writing the recursion themselves.

      Returns (Stuff & Containable)[]