Package dev.twilite.game.wrapper
Class GrandExchangeOffer
java.lang.Object
dev.twilite.game.wrapper.GrandExchangeOffer
Snapshot wrapper for a Grand Exchange offer slot.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumGrand Exchange offer lifecycle state.static enumGrand Exchange offer direction. -
Constructor Summary
ConstructorsConstructorDescriptionGrandExchangeOffer(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 TypeMethodDescriptionvoidabort()Aborts this offer from the overview.booleanaborted()Returns whether this offer finished in an aborted or partially completed state.booleanactive()Returns whether this offer is currently being created or is actively trading.intamount()Returns the requested item amount.booleanCollects this offer using the specified mode.booleanempty()Returns whether this offer slot is empty or not currently usable.booleanfinished()Returns whether this offer completed normally.item()Returns the offered item stack when available.doubleprogress()Returns completion progress from0.0to1.0.intReturns the remaining item amount.intslot()Returns the offer slot index.intspent()Returns the coins spent or received so far.state()Returns the offer state.intReturns the amount bought or sold so far.type()Returns the offer type.intReturns the unit price.
-
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 memoryslot- zero-based offer slot index
-
-
Method Details
-
slot
public int slot()Returns the offer slot index. -
item
Returns the offered item stack when available. -
type
Returns the offer type. -
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 from0.0to1.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
Collects this offer using the specified mode.
-