2011-05-15 19:33:03 +02:00
|
|
|
package com.Acrobot.ChestShop;
|
2011-05-15 18:16:25 +02:00
|
|
|
|
|
|
|
import com.nijikokun.register.payment.Method;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Acrobot
|
2011-05-29 13:25:25 +02:00
|
|
|
* Economy management
|
2011-05-15 18:16:25 +02:00
|
|
|
*/
|
|
|
|
public class Economy {
|
|
|
|
public static Method economy;
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
public static boolean hasAccount(String p) {
|
2011-05-15 18:16:25 +02:00
|
|
|
return economy.hasAccount(p);
|
|
|
|
}
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
public static void add(String name, float amount) {
|
2011-05-15 18:16:25 +02:00
|
|
|
economy.getAccount(name).add(amount);
|
|
|
|
}
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
public static void substract(String name, float amount) {
|
2011-05-15 18:16:25 +02:00
|
|
|
economy.getAccount(name).subtract(amount);
|
|
|
|
}
|
2011-05-29 13:25:25 +02:00
|
|
|
|
2011-05-15 18:16:25 +02:00
|
|
|
public static boolean hasEnough(String name, float amount) {
|
|
|
|
return economy.getAccount(name).hasEnough(amount);
|
|
|
|
}
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
public static double balance(String name) {
|
2011-05-15 18:16:25 +02:00
|
|
|
return economy.getAccount(name).balance();
|
|
|
|
}
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
public static String formatBalance(double amount) {
|
2011-05-15 18:16:25 +02:00
|
|
|
return economy.format(amount);
|
|
|
|
}
|
|
|
|
}
|