Package com.iCo6

Examples of com.iCo6.iConomy


        }
      }
    }
    else if(Bukkit.getPluginManager().getPlugin("iConomy") instanceof iConomy)
    {
      iConomyEcon = new Accounts();
     
      if(iConomyEcon != null)
        Bukkit.getLogger().fine("iConomy detected and connected, economy available.");
    }
   
View Full Code Here


    }

    @Override
    public double getBalance(String playerName) {
        this.checkExist(playerName);
        return new Accounts().get(playerName).getHoldings().getBalance();
    }
View Full Code Here

    }

    @Override
    public boolean add(String playerName, double amount) {
        this.checkExist(playerName);
        new Accounts().get(playerName).getHoldings().add(amount);
        return true;
    }
View Full Code Here

    @Override
    public boolean subtract(String playerName, double amount) {
        this.checkExist(playerName);
        if (this.canAfford(playerName, amount)) {
            new Accounts().get(playerName).getHoldings().subtract(amount);
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean transfer(String playerFrom, String playerTo, double amount) {
        this.checkExist(playerTo);
        this.checkExist(playerFrom);
        if (this.canAfford(playerFrom, amount)) {
            Account p1 = new Accounts().get(playerFrom);
            Account p2 = new Accounts().get(playerTo);
            p1.getHoldings().subtract(amount);
            p2.getHoldings().add(amount);
            return true;
        }
        return false;
View Full Code Here

        }
        return false;
    }

    private void checkExist(String playerName) {
        Accounts acc = new Accounts();
        if (!acc.exists(playerName)) {
            acc.create(playerName);
        }
    }
View Full Code Here

 
  public iConomy6Balance (ShowCaseStandalone scs, iConomy iconomy) {
//    super (scs);
    this.iconomy  = iconomy;
    this.scs    = scs;
    accounts     = new Accounts ();
  }
View Full Code Here

    public boolean hasBank(String bank) {
        return false;
    }

    public boolean hasAccount(String name) {
        return (new Accounts()).exists(name);
    }
View Full Code Here

    public boolean createAccount(String name) {
        if(hasAccount(name))
            return false;
       
        return (new Accounts()).create(name);
    }
View Full Code Here

    public boolean createAccount(String name, double balance) {
        if(hasAccount(name))
            return false;
       
        return (new Accounts()).create(name, balance);
    }
View Full Code Here

TOP

Related Classes of com.iCo6.iConomy

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.