summaryrefslogtreecommitdiffstats
path: root/EssentialsiConomyBridge5/src/com/nijiko/coelho/iConomy/system/Bank.java
diff options
context:
space:
mode:
authorxeology <xeology@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-02 22:54:38 +0000
committerxeology <xeology@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-02 22:54:38 +0000
commit5b4ecb6cc1606ac875e547305188f6fe3ac651ad (patch)
treec83735abc84c91b0a033d7654fb5a4161deda6b9 /EssentialsiConomyBridge5/src/com/nijiko/coelho/iConomy/system/Bank.java
parent6e6b2df3087673d5b6bda540ed73753bcfb534c4 (diff)
downloadEssentials-5b4ecb6cc1606ac875e547305188f6fe3ac651ad.tar
Essentials-5b4ecb6cc1606ac875e547305188f6fe3ac651ad.tar.gz
Essentials-5b4ecb6cc1606ac875e547305188f6fe3ac651ad.tar.lz
Essentials-5b4ecb6cc1606ac875e547305188f6fe3ac651ad.tar.xz
Essentials-5b4ecb6cc1606ac875e547305188f6fe3ac651ad.zip
EXPIRIMENTAL Essentials Iconomy Bridge for iConomy 5.0. This has reverse compatability and is tested but unsure of 5.0 API, needs testing but no 5.0 API plugins yet!
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1324 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsiConomyBridge5/src/com/nijiko/coelho/iConomy/system/Bank.java')
-rw-r--r--EssentialsiConomyBridge5/src/com/nijiko/coelho/iConomy/system/Bank.java73
1 files changed, 73 insertions, 0 deletions
diff --git a/EssentialsiConomyBridge5/src/com/nijiko/coelho/iConomy/system/Bank.java b/EssentialsiConomyBridge5/src/com/nijiko/coelho/iConomy/system/Bank.java
new file mode 100644
index 000000000..1c94fa311
--- /dev/null
+++ b/EssentialsiConomyBridge5/src/com/nijiko/coelho/iConomy/system/Bank.java
@@ -0,0 +1,73 @@
+package com.nijiko.coelho.iConomy.system;
+
+import com.earth2me.essentials.api.Economy;
+import com.nijiko.coelho.iConomy.existCheck;
+
+
+public class Bank
+{
+ private String id = null;
+ private String name = null;
+
+ public Bank(String name)
+ {
+ this.id = name;
+ this.name = name;
+ }
+ //The fake formatter
+
+ public String format(double amount)
+ {
+ return Economy.format(amount);
+ }
+
+ //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)
+ {
+ Account Account = null;
+ Account = new Account(name);
+ hasAccount(name);
+ return Account;
+ }
+
+ //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);
+ }
+ }
+}