|
|
|
@ -1,5 +1,7 @@
|
|
|
|
package com.dungeoncrawler.model;
|
|
|
|
package com.dungeoncrawler.model;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.dungeoncrawler.model.items.Key;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class Inventory {
|
|
|
|
public class Inventory {
|
|
|
|
|
|
|
|
|
|
|
|
@ -54,11 +56,21 @@ public class Inventory {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean checkKey(){
|
|
|
|
public boolean checkKey(){
|
|
|
|
|
|
|
|
for(int i = 0; i < items.length; i++){
|
|
|
|
|
|
|
|
if(items[i].getId() == 0){
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void deleteKey(){
|
|
|
|
public void deleteKey(){
|
|
|
|
|
|
|
|
for(int i = 0; i < items.length; i++){
|
|
|
|
|
|
|
|
if(items[i].getId() == 0){
|
|
|
|
|
|
|
|
items[i] = null;
|
|
|
|
|
|
|
|
i = items.length + 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|