Package com.iConomy.system

Examples of com.iConomy.system.Account


import com.iConomy.system.Account;

public class IConomy5Adapter implements EconomyInterface {

    public double getBalance(String playerName) {
        Account acc = iConomy.getAccount(playerName);
        return (acc == null) ? 0 : acc.getHoldings().balance();
    }
View Full Code Here


    public boolean canAfford(String playerName, double amount) {
        if (amount == 0) {
            return true;
        }
        Account acc = iConomy.getAccount(playerName);
        return (acc == null) ? false : acc.getHoldings().hasEnough(amount);
    }
View Full Code Here

        Account acc = iConomy.getAccount(playerName);
        return (acc == null) ? false : acc.getHoldings().hasEnough(amount);
    }

    public boolean add(String playerName, double amount) {
        Account acc = iConomy.getAccount(playerName);
        if (acc != null) {
            acc.getHoldings().add(amount);
            return true;
        }
        return false;
    }
View Full Code Here

        }
        return false;
    }

    public boolean subtract(String playerName, double amount) {
        Account acc = iConomy.getAccount(playerName);
        if (acc != null) {
            acc.getHoldings().subtract(amount);
            return true;
        }
        return false;
    }
View Full Code Here

        }
        return false;
    }

    public boolean transfer(String playerFrom, String playerTo, double amount) {
        Account accFrom = iConomy.getAccount(playerFrom);
        Account accTo = iConomy.getAccount(playerTo);
        if (accFrom != null && accTo != null) {
            accFrom.getHoldings().subtract(amount);
            accTo.getHoldings().add(amount);
            return true;
        }
        return false;
    }
View Full Code Here

          account.set(value);
        } else {
          TownyMessaging.sendDebugMsg("Account is still null!");
        }
      } else {
        Account account = (Account) getEconomyAccount();
        if (account != null) {
          account.getHoldings().set(value);
        } else {
          TownyMessaging.sendDebugMsg("Account is still null!");
        }
      }
View Full Code Here

        } else {
          TownyMessaging.sendDebugMsg("Account is still null!");
          return 0;
        }
      } else {
        Account account = (Account) getEconomyAccount();
        if (account != null) {
          TownyMessaging.sendDebugMsg("Economy Balance: " + account.getHoldings().balance());
          return account.getHoldings().balance();
        } else {
          TownyMessaging.sendDebugMsg("Account is still null!");
          return 0;
        }
      }
View Full Code Here

TOP

Related Classes of com.iConomy.system.Account

Copyright © 2018 www.massapicom. 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.