summaryrefslogtreecommitdiffstats
path: root/EssentialsiConomyBridge5/src/com/iConomy/system
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsiConomyBridge5/src/com/iConomy/system')
-rw-r--r--EssentialsiConomyBridge5/src/com/iConomy/system/Account.java104
-rw-r--r--EssentialsiConomyBridge5/src/com/iConomy/system/Bank.java64
-rw-r--r--EssentialsiConomyBridge5/src/com/iConomy/system/BankAccount.java47
-rw-r--r--EssentialsiConomyBridge5/src/com/iConomy/system/Holdings.java138
4 files changed, 0 insertions, 353 deletions
diff --git a/EssentialsiConomyBridge5/src/com/iConomy/system/Account.java b/EssentialsiConomyBridge5/src/com/iConomy/system/Account.java
deleted file mode 100644
index 0bdb077b4..000000000
--- a/EssentialsiConomyBridge5/src/com/iConomy/system/Account.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package com.iConomy.system;
-
-import com.earth2me.essentials.api.Economy;
-import com.iConomy.existCheck;
-import java.util.ArrayList;
-
-
-public class Account
-{
- private String name;
-
- public Holdings getHoldings()
- {
- return new Holdings(name, this.name);
- }
-
- public String getName()
- {
- return name;
- }
-
- /**
- * Essentials does not support hidden accounts.
- * @return false
- */
- public boolean setHidden(boolean hidden)
- {
- return true;
- }
-
- //Simply set the account variable type?
- public Account(String name)
- {
- this.name = name;
- }
-
- public ArrayList<Bank> withBanks()
- {
- ArrayList<Bank> banks = new ArrayList<Bank>();
- if (Economy.accountExist(name + "-bank"))
- {
- Bank bank = new Bank("EcoBanks");
- banks.add(bank);
- return banks;
- }
- return null;
- }
-
- public ArrayList<Bank> getBankAccounts()
- {
- ArrayList<Bank> banks = new ArrayList<Bank>();
- int breaker = 0;
- Bank bank;
- for (int ctr = 1; breaker != 1; ctr++)
- {
- if (ctr == 1)
- {
- if (Economy.accountExist(name + "-bank"))
- {
- bank = new Bank(name + "-bank");
- banks.add(bank);
- }
- else
- {
- breaker = 1;
- }
- }
- if (Economy.accountExist(name + "-bank" + Integer.toString(ctr)) && ctr != 1)
- {
- bank = new Bank(name + "-bank" + Integer.toString(ctr));
- banks.add(bank);
- }
- else
- {
- breaker = 1;
- }
- }
- return null;
- }
-
- /**
- * Essentials does not support hidden accounts.
- * @return false
- */
- public boolean isHidden()
- {
- return false;
- }
-
- public Bank getMainBank()
- {
- Bank bank = null;
- if (!Economy.accountExist(name + "-bank"))
- {
- Economy.newAccount(name + "-bank");
- bank = new Bank(name + "-bank");
- return bank;
- }
- bank = new Bank(name + "-bank");
- return bank;
-
-
- }
-}
diff --git a/EssentialsiConomyBridge5/src/com/iConomy/system/Bank.java b/EssentialsiConomyBridge5/src/com/iConomy/system/Bank.java
deleted file mode 100644
index ae76c8790..000000000
--- a/EssentialsiConomyBridge5/src/com/iConomy/system/Bank.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.iConomy.system;
-
-import com.earth2me.essentials.api.Economy;
-import com.iConomy.existCheck;
-
-
-public class Bank
-{
- private String id = null;
- private String name = null;
-
- public Bank(String name)
- {
- this.id = name;
- this.name = name;
- }
-
- //Fake currency!
- public String getCurrency()
- {
- return Economy.getCurrency();
- }
-
- //Fake "does player have an account?" but essentials eco doesnt need to make one, so TRUE, unless its an NPC.
- public boolean hasAccount(String account)
- {
- if (!existCheck.exist(account))
- {
- if (!Economy.accountExist(account))
- {
- Economy.newAccount(account);
- }
- }
- return true;
- }
-
- //simply switches the name to an account type?
- public Account getAccount(String name)
- {
- return new Account(name);
- }
-
- //Fake remove account
- public void removeAccount(String name)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.removeAccount(name);
- }
- return;
- }
- Economy.setMoney(name, 0);
- }
-
- public void createAccount(String account)
- {
- if (!Economy.accountExist(account))
- {
- Economy.newAccount(account);
- }
- }
-}
diff --git a/EssentialsiConomyBridge5/src/com/iConomy/system/BankAccount.java b/EssentialsiConomyBridge5/src/com/iConomy/system/BankAccount.java
deleted file mode 100644
index c3d74d01d..000000000
--- a/EssentialsiConomyBridge5/src/com/iConomy/system/BankAccount.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.iConomy.system;
-
-import com.earth2me.essentials.api.Economy;
-
-
-public class BankAccount
-{
- private String BankName;
- private String BankId;
- private String AccountName;
-
- public BankAccount(String BankName, String BankId, String AccountName)
- {
- this.BankName = BankName;
- this.BankId = BankId;
- this.AccountName = AccountName;
- }
-
- public String getBankName()
- {
- return this.BankName;
- }
-
- public String getBankId()
- {
- return this.BankId;
- }
-
- public void getAccountName(String AccountName)
- {
- this.AccountName = AccountName;
- }
-
- public Holdings getHoldings()
- {
- return new Holdings(this.BankId, this.AccountName, true);
- }
-
- public void remove(String name)
- {
- if (Economy.accountExist(BankId))
- {
- Economy.removeAccount(BankId);
- }
- return;
- }
-}
diff --git a/EssentialsiConomyBridge5/src/com/iConomy/system/Holdings.java b/EssentialsiConomyBridge5/src/com/iConomy/system/Holdings.java
deleted file mode 100644
index e256ec609..000000000
--- a/EssentialsiConomyBridge5/src/com/iConomy/system/Holdings.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package com.iConomy.system;
-
-import com.earth2me.essentials.api.Economy;
-import com.iConomy.existCheck;
-
-
-public class Holdings
-{
- private String name = "";
- private boolean bank = false;
- private String bankId = null;
-
- public Holdings(String name)
- {
- this.name = name;
- }
-
- public Holdings(String id, String name)
- {
- this.bankId = id;
- this.name = name;
- }
-
- public Holdings(String id, String name, boolean bank)
- {
- this.bank = bank;
- this.bankId = id;
- this.name = name;
- }
-
- public boolean isBank()
- {
- return bank;
- }
-
- public double balance()
- {
- return get();
- }
-
- public double get()
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- return Economy.getMoney(name);
- }
- return 0;
- }
- return Economy.getMoney(name);
- }
-
- public void set(double bal)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.setMoney(name, bal);
- }
- return;
- }
- Economy.setMoney(name, bal);
- }
-
- public void add(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.add(name, money);
- }
- return;
- }
- Economy.add(name, money);
- }
-
- public void divide(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.divide(name, money);
- }
- return;
- }
- Economy.divide(name, money);
- }
-
- public void multiply(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.multiply(name, money);
- }
- return;
- }
- Economy.multiply(name, money);
- }
-
- public void subtract(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.subtract(name, money);
- }
- return;
- }
- Economy.subtract(name, money);
- }
-
- public void reset()
- {
- this.set(0);
- }
-
- public boolean hasEnough(double amount)
- {
- return amount <= this.get();
- }
-
- public boolean hasOver(double amount)
- {
- return amount < this.get();
- }
-
- public boolean isNegative()
- {
- return this.get() < 0.0;
- }
-}