Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int addItem(Item newItem){
- int itemExists = indexOf(newItem.getName());
- if (itemExists == -1){
- return -1;
- }
- // int i = itemList.length;
- // increaseArray();
- if (newItem == null){
- return -1;
- }
- if (newItem.getDurability() < 1){
- return -1;
- }
- //
- // for (int f = 0; f < i; f++){
- // if (newItem == itemList[f]){
- // return -1;
- // }
- // }
- //
- // itemList[i] = newItem;
- // return i;
- increaseArray();
- itemList[itemList.length] = newItem;
- return i;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement