Shop

open class Shop

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

Constructors

Link copied to clipboard
constructor()

Types

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

Functions

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