added bankBalance method woops! - fixed bank error message in

MineConomy.
This commit is contained in:
Sleaker 2011-11-29 08:51:44 -08:00
parent 36f6a15fd3
commit 2d92a152d3
11 changed files with 74 additions and 6 deletions

View File

@ -84,6 +84,13 @@ public interface Economy {
*/
public EconomyResponse createBank(String name, String player);
/**
* Returns the amount the bank has
* @param name
* @return
*/
public EconomyResponse bankBalance(String name);
/**
* Returns true or false whether the bank has the amount specified
* @param name

View File

@ -221,4 +221,9 @@ public class Economy_3co implements Economy {
public EconomyResponse isBankMember(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
}
@Override
public EconomyResponse bankBalance(String name) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
}
}

View File

@ -270,4 +270,13 @@ public class Economy_BOSE6 implements Economy {
} else
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That player is not a bank member!");
}
@Override
public EconomyResponse bankBalance(String name) {
if (!economy.bankExists(name))
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That bank does not exist!");
double bankMoney = economy.getBankMoney(name);
return new EconomyResponse(0, bankMoney, ResponseType.SUCCESS, null);
}
}

View File

@ -264,7 +264,16 @@ public class Economy_BOSE7 implements Economy {
} else
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That player is not a bank member!");
}
@Override
public EconomyResponse bankBalance(String name) {
if (!economy.bankExists(name))
return new EconomyResponse(0, 0, ResponseType.FAILURE, "That bank does not exist!");
double bankMoney = economy.getBankMoney(name);
return new EconomyResponse(0, bankMoney, ResponseType.SUCCESS, null);
}
@Override
public boolean has(String playerName, double amount) {
return getBalance(playerName) >= amount;

View File

@ -244,4 +244,9 @@ public class Economy_Essentials implements Economy {
public EconomyResponse isBankMember(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "Essentials Eco does not support bank accounts!");
}
@Override
public EconomyResponse bankBalance(String name) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "Essentials Eco does not support bank accounts!");
}
}

View File

@ -126,31 +126,36 @@ public class Economy_MineConomy implements Economy {
@Override
public EconomyResponse createBank(String name, String player) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
}
@Override
public EconomyResponse bankHas(String name, double amount) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
}
@Override
public EconomyResponse bankWithdraw(String name, double amount) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
}
@Override
public EconomyResponse bankDeposit(String name, double amount) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
}
@Override
public EconomyResponse isBankOwner(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
}
@Override
public EconomyResponse isBankMember(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
}
@Override
public EconomyResponse bankBalance(String name) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MineConomy does not support bank accounts!");
}
}

View File

@ -224,4 +224,9 @@ public class Economy_MultiCurrency implements Economy {
public EconomyResponse isBankMember(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MultiCurrency does not support bank accounts");
}
@Override
public EconomyResponse bankBalance(String name) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "MultiCurrency does not support bank accounts");
}
}

View File

@ -160,4 +160,9 @@ public class Economy_eWallet implements Economy {
public EconomyResponse isBankMember(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
}
@Override
public EconomyResponse bankBalance(String name) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "3co does not support bank accounts!");
}
}

View File

@ -235,4 +235,9 @@ public class Economy_iConomy4 implements Economy {
public EconomyResponse isBankMember(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy4 does not support bank accounts!");
}
@Override
public EconomyResponse bankBalance(String name) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy4 does not support bank accounts!");
}
}

View File

@ -198,4 +198,9 @@ public class Economy_iConomy5 implements Economy {
public EconomyResponse isBankMember(String name, String playerName) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy5 does not support single bank accounts!");
}
@Override
public EconomyResponse bankBalance(String name) {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy5 does not support single bank accounts!");
}
}

View File

@ -189,4 +189,12 @@ public class Economy_iConomy6 implements Economy {
return new EconomyResponse(0, 0, ResponseType.NOT_IMPLEMENTED, "iConomy 6 does not support Bank members.");
}
@Override
public EconomyResponse bankBalance(String name) {
if (!accounts.exists(name))
return new EconomyResponse(0, 0, ResponseType.FAILURE, "There is no bank account with that name");
else
return new EconomyResponse(0, accounts.get(name).getHoldings().getBalance(), ResponseType.SUCCESS, null);
}
}