Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected ArrayList<Integer> wishFood = new ArrayList<Integer>();
- protected int tryCount = 0;
- public int getTry() { return tryCount; }
- public String getWish() {
- return Arrays.toString(wishFood.toArray());
- }
- public boolean checkWish(int food) {
- this.tryCount += 1;
- return wishFood.contains(food);
- }
- public void takeWish(int food) {
- int index = wishFood.indexOf(food);
- if (index != -1)
- wishFood.remove(index);
- }
- public void addWish(int food) {
- wishFood.add(food);
- }
- public boolean isDone() {
- return wishFood.isEmpty();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement