Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ShopListener

[16:7] extends: FxObj

Wraps an AussomShopListener (implementation of FXGL's ShopListener interface) so Aussom code can react to buy and sell events on a Shop. Each callback receives the TradeItem involved as an AussomJavaObject. Install on a Shop via Shop.setListener(this.obj).

Methods

  • ShopListener ()

    Creates a new ShopListener. Wire onSold / onBought, then install on a Shop.

  • adopt (object Ajo)

    Wraps an existing ShopListener AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an AussomShopListener.
    • @r A new wrapper.
  • onSold (callback Cb)

    Registers the onSold callback (fires when this shop sells an item to another shop).

    • @p Cb is a callback(tradeItemAjo) -> void.
    • @r this object
  • onBought (callback Cb)

    Registers the onBought callback (fires when this shop buys an item from another shop).

    • @p Cb is a callback(tradeItemAjo) -> void.
    • @r this object