Examples of Holdings


Examples of com.iCo6.system.Holdings

            Messaging.send(sender, tag + template.parse());
            return false;
        }

        Account holder = new Account(from.getName());
        Holdings holdings = holder.getHoldings();

        if(holdings.getBalance() < amount) {
            template.set(Template.Node.ERROR_FUNDS);
            Messaging.send(sender, tag + template.parse());
            return false;
        }

        Account account = new Account(name);
        holdings.subtract(amount);
        account.getHoldings().add(amount);

        template.set(Template.Node.PAYMENT_TO);
        template.add("name", name);
        template.add("amount", iConomy.format(amount));
View Full Code Here

Examples of com.iCo6.system.Holdings

    public EconomyResponse withdrawPlayer(String playerName, double amount) {
        if (amount < 0) {
            return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot withdraw negative funds");
        }

        Holdings holdings = accounts.get(playerName).getHoldings();
        if (holdings.hasEnough(amount)) {
            holdings.subtract(amount);
            return new EconomyResponse(amount, holdings.getBalance(), ResponseType.SUCCESS, null);
        } else {
            return new EconomyResponse(0, holdings.getBalance(), ResponseType.FAILURE, "Insufficient funds");
        }
    }
View Full Code Here

Examples of com.iCo6.system.Holdings

    public EconomyResponse depositPlayer(String playerName, double amount) {
        if (amount < 0) {
            return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot desposit negative funds");
        }

        Holdings holdings = accounts.get(playerName).getHoldings();
        holdings.add(amount);
        return new EconomyResponse(amount, holdings.getBalance(), ResponseType.SUCCESS, null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.