Basics
Guides
API Reference
Basics
Guides
API Reference
[13:7] extends: FxObj
Wraps FXGL's Shop (com.almasb.fxgl.trade.Shop), a container of TradeItems with a money balance. A Shop can buy items from another Shop using buyFrom; the money balance moves with the trade and a registered ShopListener fires for both sides.
Shop (int InitialMoney = 0, ItemsList = null)
Creates a new Shop with the given starting money and initial item list. Pass null for ItemsList to construct an empty wrapper for adopt.
InitialMoney is the starting money balance.ItemsList is an Aussom list of TradeItem wrappers.adopt (object Ajo)
Wraps an existing Shop AussomJavaObject.
Ajo is an AussomJavaObject around a Shop.A new wrapper.getMoney ()
Returns the current money balance. @r An int.
setMoney (int Money)
Sets the money balance.
Money is the new balance.this objectmoneyProperty ()
Returns the IntegerProperty backing the money balance for binding to a UI label.
An AussomJavaObject around an IntegerProperty.getItems ()
Returns the underlying ObservableList of TradeItems.
An AussomJavaObject around an ObservableListsetListener (object ListenerObj)
Sets the ShopListener that fires on buy and sell events.
ListenerObj is a ShopListener wrapper.this objectgetListener ()
Returns the currently-registered ShopListener AJO, or null.
An AussomJavaObject around a ShopListener, or null.buyFrom (object OtherShopObj, object TradeItemObj, int Qty)
Buys Qty of the given TradeItem from Other. Moves money and the item between shops; fires both listeners.
OtherShopObj is the seller Shop wrapper.TradeItemObj is the TradeItem wrapper to buy.Qty is the quantity to buy.A bool — true on success, false if the buyer has too little money or the seller has too few items.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.