diff --git a/MerchantRPGCSE2102/src/controller/RPGame.java b/MerchantRPGCSE2102/src/controller/RPGame.java index a60174f..ae9c1e1 100644 --- a/MerchantRPGCSE2102/src/controller/RPGame.java +++ b/MerchantRPGCSE2102/src/controller/RPGame.java @@ -14,9 +14,7 @@ public class RPGame { private ArrayList merchantInventoryList3 = new ArrayList(); // merchant 3's inventory list private ArrayList playerInventoryList = new ArrayList(); // the player's inventory list private Player _player; - private Merchant _merchant1; - private Merchant _merchant2; - private Merchant _merchant3; + private Merchant _merchant1, _merchant2, _merchant3; private boolean _movement; private int _currentDay; private int _transactionLimit; @@ -25,6 +23,7 @@ public class RPGame { public RPGame() { _currentDay = 1; _transactionLimit = 3; + inventoryFromFile(); } /** @@ -235,6 +234,15 @@ else if(merchantNum == 2) else return _merchant3; } + + /** + * Getter for the current day number + * @return The day number + */ + public int getDay() + { + return _currentDay; + } /** * Main method used to test the GUI components since test classes do not maintain the GUI @@ -243,7 +251,6 @@ else if(merchantNum == 2) public static void main(String[] args) { RPGame _rpg = new RPGame(); - _rpg.inventoryFromFile(); _rpg.buildMerchants(); ArrayList playerInventory = _rpg.getMerchantInventoryList(1); playerInventory.addAll(_rpg.getMerchantInventoryList(2)); diff --git a/MerchantRPGCSE2102/src/tests/TestRPGame.java b/MerchantRPGCSE2102/src/tests/TestRPGame.java index 78324a6..12504ef 100644 --- a/MerchantRPGCSE2102/src/tests/TestRPGame.java +++ b/MerchantRPGCSE2102/src/tests/TestRPGame.java @@ -12,7 +12,6 @@ public class TestRPGame extends TestCase public void setup() { game = new RPGame(); - game.inventoryFromFile(); game.buildMerchants(); ArrayList playerInventory = game.getMerchantInventoryList(1); playerInventory.addAll(game.getMerchantInventoryList(2)); @@ -37,6 +36,6 @@ public void testFile() public void testDailyCycle() { setup(); - + assertEquals(1, game.getDay()); } }