2bad2rage 0 Posted October 22, 2016 This is my code for selling items to the shop that are not currently in the shop but it seems to me that the getShop().contains(i) does not work? If someone could clear this up for me that would be great. List<Item> inv = getInventory().getCollection(); for (Item i : inv) { if (getShop().contains(i) == true) { continue; } else { if ((getShop().fullSlotCount() < 39)) { getShop().sell(i, 1); } } }
Pandemic 2853 Posted October 22, 2016 Item's equal method checks for amount, so the contains method wouldn't work there, try using contains(i.getID()) instead.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.