Package com.valhalla.sdk.api.bank
Class BankSnapshot
java.lang.Object
com.valhalla.sdk.api.bank.BankSnapshot
Immutable native bank-container and interface-state snapshot.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFallback number of bank slots when the native client does not report one. -
Constructor Summary
ConstructorsConstructorDescriptionBankSnapshot(List<Item> items, boolean loaded, boolean open, int capacity, int currentTab, int availableTabs, int scrollHeight, int customWithdrawAmount, int firstVisibleSlot, int lastVisibleSlot, BankMode withdrawMode, BankMode rearrangeMode, BankQuantitySelection defaultQuantity, boolean placeholdersEnabled, boolean searchOpen, long updatedTick) Creates an immutable bank snapshot from native container and interface state. -
Method Summary
Modifier and TypeMethodDescriptionstatic BankSnapshotempty()Returns an unloaded, closed bank snapshot with safe defaults.intReturns the number of available optional tabs.intReturns the total bank slot capacity.intReturns the selected tab identifier.intReturns the configured custom withdrawal amount.Returns the selected default quantity button.intReturns the first visible bank slot, or-1.getItems()Returns an immutable list of occupied bank slots.intReturns the last visible bank slot, or-1.Returns the current swap-or-insert rearrangement mode.intReturns the bank-container scroll offset.longReturns the native tick on which this snapshot was updated.Returns the current item-or-note withdrawal mode.booleanisLoaded()Returns whether bank state was successfully decoded.booleanisOpen()Returns whether the bank interface is open.booleanReturns whether bank placeholders are enabled.booleanReturns whether the bank search interface is open.
-
Field Details
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITYFallback number of bank slots when the native client does not report one.- See Also:
-
-
Constructor Details
-
BankSnapshot
public BankSnapshot(List<Item> items, boolean loaded, boolean open, int capacity, int currentTab, int availableTabs, int scrollHeight, int customWithdrawAmount, int firstVisibleSlot, int lastVisibleSlot, BankMode withdrawMode, BankMode rearrangeMode, BankQuantitySelection defaultQuantity, boolean placeholdersEnabled, boolean searchOpen, long updatedTick) Creates an immutable bank snapshot from native container and interface state.- Parameters:
items- occupied bank slotsloaded- whether bank state was decodedopen- whether the bank interface is opencapacity- total slot capacitycurrentTab- selected tab identifieravailableTabs- number of optional tabsscrollHeight- current scroll offsetcustomWithdrawAmount- configured X amountfirstVisibleSlot- first visible slot, or-1lastVisibleSlot- last visible slot, or-1withdrawMode- item or note withdrawal moderearrangeMode- swap or insert rearrangement modedefaultQuantity- selected amount buttonplaceholdersEnabled- whether placeholders are enabledsearchOpen- whether bank search is openupdatedTick- native update tick
-
-
Method Details
-
empty
Returns an unloaded, closed bank snapshot with safe defaults.- Returns:
- an unloaded, closed bank snapshot with safe defaults
-
getItems
Returns an immutable list of occupied bank slots.- Returns:
- an immutable list of occupied bank slots
-
isLoaded
public boolean isLoaded()Returns whether bank state was successfully decoded.- Returns:
- whether bank state was successfully decoded
-
isOpen
public boolean isOpen()Returns whether the bank interface is open.- Returns:
- whether the bank interface is open
-
getCapacity
public int getCapacity()Returns the total bank slot capacity.- Returns:
- the total bank slot capacity
-
getCurrentTab
public int getCurrentTab()Returns the selected tab identifier.- Returns:
- the selected tab identifier
-
getAvailableTabs
public int getAvailableTabs()Returns the number of available optional tabs.- Returns:
- the number of available optional tabs
-
getScrollHeight
public int getScrollHeight()Returns the bank-container scroll offset.- Returns:
- the bank-container scroll offset
-
getCustomWithdrawAmount
public int getCustomWithdrawAmount()Returns the configured custom withdrawal amount.- Returns:
- the configured custom withdrawal amount
-
getFirstVisibleSlot
public int getFirstVisibleSlot()Returns the first visible bank slot, or-1.- Returns:
- the first visible bank slot, or
-1
-
getLastVisibleSlot
public int getLastVisibleSlot()Returns the last visible bank slot, or-1.- Returns:
- the last visible bank slot, or
-1
-
getWithdrawMode
Returns the current item-or-note withdrawal mode.- Returns:
- the current item-or-note withdrawal mode
-
getRearrangeMode
Returns the current swap-or-insert rearrangement mode.- Returns:
- the current swap-or-insert rearrangement mode
-
getDefaultQuantity
Returns the selected default quantity button.- Returns:
- the selected default quantity button
-
isPlaceholdersEnabled
public boolean isPlaceholdersEnabled()Returns whether bank placeholders are enabled.- Returns:
- whether bank placeholders are enabled
-
isSearchOpen
public boolean isSearchOpen()Returns whether the bank search interface is open.- Returns:
- whether the bank search interface is open
-
getUpdatedTick
public long getUpdatedTick()Returns the native tick on which this snapshot was updated.- Returns:
- the native tick on which this snapshot was updated
-