summaryrefslogtreecommitdiffstats
path: root/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
diff options
context:
space:
mode:
authorxeology <xeology@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-02 09:56:40 +0000
committerxeology <xeology@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-02 09:56:40 +0000
commit98fef1131b69e8bb138c99cd4a0140d996bd774a (patch)
treee073fc1dbee554d826b9ca108ce34c325b356ba4 /EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
parent966ef1ce32a51566e695c2568cc08d0bc9c67a4c (diff)
downloadEssentials-98fef1131b69e8bb138c99cd4a0140d996bd774a.tar
Essentials-98fef1131b69e8bb138c99cd4a0140d996bd774a.tar.gz
Essentials-98fef1131b69e8bb138c99cd4a0140d996bd774a.tar.lz
Essentials-98fef1131b69e8bb138c99cd4a0140d996bd774a.tar.xz
Essentials-98fef1131b69e8bb138c99cd4a0140d996bd774a.zip
FayConomy is now EssentialsiConomyBridge, done and ported, fully functional. Relies on EcoAPI!
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1316 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java')
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java149
1 files changed, 149 insertions, 0 deletions
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
new file mode 100644
index 000000000..740b31f58
--- /dev/null
+++ b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
@@ -0,0 +1,149 @@
+package com.nijiko.coelho.iConomy.system;
+
+import com.earth2me.essentials.EcoAPI;
+import com.nijiko.coelho.iConomy.existCheck;
+
+
+public class Account
+{
+ private String name;
+
+ //Fake getname
+ public String getName()
+ {
+ return name;
+ }
+
+ //Essentials doesnt have hidden accounts so just say yeah whatever!
+ public boolean setHidden(boolean hidden)
+ {
+ return true;
+ }
+
+ //Simply set the account variable type?
+ public Account(String name)
+ {
+ this.name = name;
+ }
+
+ //Fake return balance
+ public double getBalance()
+ {
+ if (!existCheck.exist(name))
+ {
+ if (EcoAPI.accountExist(name))
+ {
+ return EcoAPI.getMoney(name);
+ }
+ return 0;
+ }
+ return EcoAPI.getMoney(name);
+ }
+
+ //Fake Set balance
+ public void setBalance(double bal)
+ {
+ if (!existCheck.exist(name))
+ {
+ if (EcoAPI.accountExist(name))
+ {
+ EcoAPI.setMoney(name, bal);
+ }
+ return;
+ }
+ EcoAPI.setMoney(name, bal);
+ }
+
+ //Fake add balance
+ public void add(double money)
+ {
+ if (!existCheck.exist(name))
+ {
+ if (EcoAPI.accountExist(name))
+ {
+ EcoAPI.add(name, money);
+ }
+ return;
+ }
+ EcoAPI.add(name, money);
+ }
+
+ //Fake divide balance
+ public void divide(double money)
+ {
+ if (!existCheck.exist(name))
+ {
+ if (EcoAPI.accountExist(name))
+ {
+ EcoAPI.divide(name, money);
+ }
+ return;
+ }
+ EcoAPI.divide(name, money);
+ }
+
+ //Fake multiply balance
+ public void multiply(double money)
+ {
+ if (!existCheck.exist(name))
+ {
+ if (EcoAPI.accountExist(name))
+ {
+ EcoAPI.multiply(name, money);
+ }
+ return;
+ }
+ EcoAPI.multiply(name, money);
+ }
+
+ //Fake subtract balance
+ public void subtract(double money)
+ {
+ if (!existCheck.exist(name))
+ {
+ if (EcoAPI.accountExist(name))
+ {
+ EcoAPI.subtract(name, money);
+ }
+ return;
+ }
+ EcoAPI.subtract(name, money);
+ }
+
+ //fake reset balance!
+ public void resetBalance()
+ {
+ this.setBalance(0);
+ }
+
+ //fake bal check
+ public boolean hasEnough(double amount)
+ {
+ return amount <= this.getBalance();
+ }
+
+ //fake another balance check
+ public boolean hasOver(double amount)
+ {
+ return amount < this.getBalance();
+ }
+
+ //Again we dont have hidden accounts here!
+ public boolean isHidden()
+ {
+ return false;
+ }
+
+ //Fake is negative check!
+ public boolean isNegative()
+ {
+ return this.getBalance() < 0.0;
+ }
+
+ //Because some plugins like to use depricated methods I must save
+ //admins' log from the overflow of dumb
+ public void save()
+ {
+ }
+;
+}