Class GrandExchange

java.lang.Object
dev.twilite.game.facade.GrandExchange

public class GrandExchange extends Object
Grand Exchange state and offer helpers.
  • Constructor Details

    • GrandExchange

      public GrandExchange()
  • Method Details

    • inventory

      public static ItemView inventory()
      Returns a lazy view over items in the inventory (GeOffersSide).
    • showing

      public static boolean showing()
      Returns whether the Grand Exchange interface is visible.
    • close

      public static void close()
      Closes the grand exchange interface
    • open

      public static void open()
      Opens the Grand Exchange through a nearby booth or clerk.
    • offers

      public static GrandExchangeOfferView offers()
      Returns a lazy view over all native offer slots.
    • offer

      public static Optional<GrandExchangeOffer> offer(int slot)
      Returns the offer at a slot.
    • selectedOffer

      public static Optional<GrandExchangeOffer> selectedOffer()
      Returns the currently viewed offer.
    • selectedSlot

      public static int selectedSlot()
      Returns the selected offer slot, or -1 when no offer is selected.
    • screen

      public static GrandExchange.Screen screen()
      Returns the current Grand Exchange view.
    • openOverview

      public static void openOverview()
      Returns to the main offer overview when the Grand Exchange is on an offer screen.
    • slots

      public static int slots()
      Returns the number of usable offer slots.
    • usedSlots

      public static int usedSlots()
      Returns the number of non-empty offer slots.
    • freeSlots

      public static int freeSlots()
      Returns the number of empty offer slots.
    • full

      public static boolean full()
      Returns whether every usable offer slot is occupied.
    • buy

      public static GrandExchange.Request buy(int itemId)
      Starts building a buy request for an item id.
    • sell

      public static GrandExchange.Request sell(int itemId)
      Starts building a sell request for an item id.
    • sell

      public static GrandExchange.Request sell(Function<ItemView,Optional<Item>> item)
      Starts building a sell request selected from the inventory.
    • collectAll

      public static boolean collectAll(GrandExchange.CollectionMode mode)
      Collects all completed offers to the selected destination.
    • collect

      public static boolean collect(GrandExchangeOffer offer)
      Collects an offer to the inventory.
    • collect

      public static boolean collect(GrandExchangeOffer offer, GrandExchange.CollectionMode mode)
      Collects an offer using the selected destination.
    • collectViewed

      public static boolean collectViewed(GrandExchange.CollectionMode mode)
      Collects the currently viewed offer to the selected destination.