Developer API

Creating a custom CurrencyManager

public void example() {
    /**
     * #setCostCurrencyManager changes the currency used to purchase robot upgrades
     * #setGeneratorCurrencyManager changes the currency used to generate money from the robots.
     */
    Core.c.setCostCurrencyManager(
            new CurrencyManager() {
                
                @Override
                public void load() {
                    // Pre-Load method to setup currency manager
                }

                @Override
                public double getCurrentBalance(Player p) {
                    // Get the current balance of a Player. 
                    return 0;
                }

                @Override
                public boolean chargeAmount(Player p, double amt) {
                    // Charge the player for upgrades
                    return false;
                }

                @Override
                public boolean withdraw(Player p, double amt) {
                    // Withdraw _to_ a players account.
                    return false;
                }
            }
    );
}

Getting Robots from by Location

Last updated

Was this helpful?