Class ShopSlot

java.lang.Object
privbot.hooks.shop.ShopSlot

public final class ShopSlot extends Object
One occupied slot in a shop's stock container.

Deliberately not a Widget. On Impact a shop's stock is a single container hanging off one widget — there are no per-slot child widgets to hold — and a player's buy click names the item id, the slot index and the container's widget id. This type carries exactly those three, so a buy is sent the way the player's own click is.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ShopSlot(int containerWidgetId, int slotIndex, int itemId, String itemName, int stock)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Owning widget — the param1 of a buy.
    int
    Item held here — the identifier of a buy.
    Display name, or null when the definition could not be resolved.
    int
    Position within the container — the param0 of a buy.
    int
    Units the shop still has, as reported by the container's quantity array.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ShopSlot

      public ShopSlot(int containerWidgetId, int slotIndex, int itemId, String itemName, int stock)
  • Method Details

    • containerWidgetId

      public int containerWidgetId()
      Owning widget — the param1 of a buy.
    • slotIndex

      public int slotIndex()
      Position within the container — the param0 of a buy.
    • itemId

      public int itemId()
      Item held here — the identifier of a buy.
    • itemName

      public String itemName()
      Display name, or null when the definition could not be resolved.
    • stock

      public int stock()
      Units the shop still has, as reported by the container's quantity array.
    • toString

      public String toString()
      Overrides:
      toString in class Object