Class GrandExchangeOffer

java.lang.Object
dev.twilite.game.wrapper.GrandExchangeOffer

public class GrandExchangeOffer extends Object
Snapshot wrapper for a Grand Exchange offer slot.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Grand Exchange offer lifecycle state.
    static enum 
    Grand Exchange offer direction.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrandExchangeOffer(dev.twilite.game.internal.memory.RSGrandExchangeOffer memory, int slot)
    Wraps a Grand Exchange offer memory entry and its offer slot index.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Aborts this offer from the overview.
    boolean
    Returns whether this offer finished in an aborted or partially completed state.
    boolean
    Returns whether this offer is currently being created or is actively trading.
    int
    Returns the requested item amount.
    boolean
    Collects this offer using the specified mode.
    boolean
    Returns whether this offer slot is empty or not currently usable.
    boolean
    Returns whether this offer completed normally.
    Returns the offered item stack when available.
    double
    Returns completion progress from 0.0 to 1.0.
    int
    Returns the remaining item amount.
    int
    Returns the offer slot index.
    int
    Returns the coins spent or received so far.
    Returns the offer state.
    int
    Returns the amount bought or sold so far.
    Returns the offer type.
    int
    Returns the unit price.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GrandExchangeOffer

      public GrandExchangeOffer(dev.twilite.game.internal.memory.RSGrandExchangeOffer memory, int slot)
      Wraps a Grand Exchange offer memory entry and its offer slot index.
      Parameters:
      memory - backing client offer memory
      slot - zero-based offer slot index
  • Method Details

    • slot

      public int slot()
      Returns the offer slot index.
    • item

      public Optional<Item> item()
      Returns the offered item stack when available.
    • type

      public GrandExchangeOffer.Type type()
      Returns the offer type.
    • state

      public GrandExchangeOffer.State state()
      Returns the offer state.
    • unitPrice

      public int unitPrice()
      Returns the unit price.
    • amount

      public int amount()
      Returns the requested item amount.
    • transferred

      public int transferred()
      Returns the amount bought or sold so far.
    • spent

      public int spent()
      Returns the coins spent or received so far.
    • remaining

      public int remaining()
      Returns the remaining item amount.
    • progress

      public double progress()
      Returns completion progress from 0.0 to 1.0.
    • empty

      public boolean empty()
      Returns whether this offer slot is empty or not currently usable.
    • active

      public boolean active()
      Returns whether this offer is currently being created or is actively trading.
    • finished

      public boolean finished()
      Returns whether this offer completed normally.
    • aborted

      public boolean aborted()
      Returns whether this offer finished in an aborted or partially completed state.
    • abort

      public void abort()
      Aborts this offer from the overview.
    • collect

      public boolean collect(GrandExchange.CollectionMode mode)
      Collects this offer using the specified mode.