SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     protected ArrayList<Integer> wishFood = new ArrayList<Integer>();
  2.     protected int tryCount = 0;
  3.    
  4.     public int getTry() { return tryCount; }
  5.    
  6.     public String getWish() {
  7.         return Arrays.toString(wishFood.toArray());
  8.     }
  9.    
  10.     public boolean checkWish(int food) {
  11.         this.tryCount += 1;
  12.         return wishFood.contains(food);
  13.     }
  14.    
  15.     public void takeWish(int food) {
  16.         int index = wishFood.indexOf(food);
  17.         if (index != -1)
  18.             wishFood.remove(index);
  19.     }
  20.  
  21.     public void addWish(int food) {
  22.         wishFood.add(food);
  23.     }
  24.    
  25.     public boolean isDone() {
  26.         return wishFood.isEmpty();
  27.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top