Shop

public class Shop

Contains methods for interacting with and inspecting the common shop interface. An example is a general store.

Types

Quantity
Link copied to clipboard
public enum Quantity
Represents a quantity that can be bought/sold at a shop

Functions

buy
Link copied to clipboard
static boolean buy(Shop.Quantity quantity, Array<int> id)
Attempts to buy the specified quantity of the first item whose id matches the specified id
static boolean buy(Shop.Quantity quantity, Array<String> name)
Attempts to buy the specified quantity of the first item whose name equals one of the specified names
static boolean buy(Shop.Quantity quantity, Predicate<Item> filter)
Attempts to buy the specified quantity of the first item which matches the specified predicate
close
Link copied to clipboard
static boolean close()
Closes the shop screen by clicking the Close button
contains
Link copied to clipboard
static boolean contains(Array<int> id)
Checks if the shop has any item with any of the specified ids
static boolean contains(Array<String> name)
Checks if the shop has any item whose name contains any of the specified names
static boolean contains(Predicate<Item> filter)
Checks if the shop has any item that matches the specified filter
getAll
Link copied to clipboard
static List<ItemgetAll()
Gets all the items listed in the shop
static List<ItemgetAll(Array<int> id)
Gets all the items listed in the shop with the specified ids
static List<ItemgetAll(Array<String> name)
Gets all the items listed in the shop that have exactly the specified names
static List<ItemgetAll(Predicate<Item> filter)
Gets all the items listed in the shop that match the specified predicate
getCount
Link copied to clipboard
static int getCount(Array<int> id)
Gets the total stack sum of all items with the specified ids
static int getCount(Array<String> name)
Gets the total stack sum of all items whose name contains any of the specified names
static int getCount(Predicate<Item> filter)
Gets the total stack sum of all items matching the specified filter
getFirst
Link copied to clipboard
static Optional<ItemgetFirst(Array<int> id)
Gets the first item listed in the shop that has any of the specified ids
static Optional<ItemgetFirst(Array<String> name)
Gets the first item listed in the shop that has exactly any of the specified names
static Optional<ItemgetFirst(Predicate<Item> filter)
Gets the first item listed in the shop that matches the specified predicate
isOpen
Link copied to clipboard
static boolean isOpen()
Checks if the shop screen is open
sell
Link copied to clipboard
static boolean sell(Shop.Quantity quantity, Array<int> id)
Attempts to sell the specified quantity of the first item whose id matches the specified id
static boolean sell(Shop.Quantity quantity, Array<String> name)
Attempts to sell the specified quantity of the first item whose name equals one of the specified names
static boolean sell(Shop.Quantity quantity, Predicate<Item> filter)
Attempts to sell the specified quantity of the first item which matches the specified predicate