summaryrefslogtreecommitdiffstats
path: root/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.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/Bank.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/Bank.java')
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java
new file mode 100644
index 000000000..b70803dda
--- /dev/null
+++ b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java
@@ -0,0 +1,53 @@
+package com.nijiko.coelho.iConomy.system;
+
+import com.earth2me.essentials.EcoAPI;
+import com.nijiko.coelho.iConomy.existCheck;
+
+
+public class Bank {
+
+ //The fake formatter
+
+ public String format(double amount) {
+ return EcoAPI.format(amount);
+ }
+
+ //Fake currency!
+
+ public String getCurrency() {
+ return EcoAPI.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 (!EcoAPI.accountExist(account)){
+ EcoAPI.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 (EcoAPI.accountExist(name)){
+ EcoAPI.removeAccount(name);
+ }
+ return;
+ }
+ EcoAPI.setMoney(name, 0);
+ }
+
+}