From e5dcc5e566aa4d41cffd5d0d97e912f91302d332 Mon Sep 17 00:00:00 2001 From: fdai7430 Date: Sat, 28 Jan 2023 14:48:34 +0100 Subject: [PATCH] Made functions in UseCommand public so they can be accessed for testing --- src/main/java/org/bitbiome/commands/UseCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/UseCommand.java b/src/main/java/org/bitbiome/commands/UseCommand.java index e734d8c..88ea8cb 100644 --- a/src/main/java/org/bitbiome/commands/UseCommand.java +++ b/src/main/java/org/bitbiome/commands/UseCommand.java @@ -33,7 +33,7 @@ private boolean combat = false; } } - private String getUseMessage(String msg, TravelEngine engine) { + public String getUseMessage(String msg, TravelEngine engine) { Player player = engine.getPlayer(); String message[] = msg.split(" on "); String itemName = message[0]; @@ -60,7 +60,7 @@ private boolean combat = false; return "That item is not in your inventory."; } - private String useItem(Item item, Player target) { + public String useItem(Item item, Player target) { float hp = target.getHp(); hp -= item.getDamage(); String retString = "You used " + item.getName() + " on yourself"; @@ -72,7 +72,7 @@ private boolean combat = false; return retString; } - private String useItem(Item item, Mob target, Location location) { + public String useItem(Item item, Mob target, Location location) { combat = true; if(target.isFriendly()) enemies.add(target); @@ -88,7 +88,7 @@ private boolean combat = false; return "You used " + item.getName() + " on " + target.getName(); } - private void getEnemies(ArrayList allMobs) { + public void getEnemies(ArrayList allMobs) { for(int i = 0; i