예제 #1
0
  private void countJars() {

    for (Cell c : cells) {
      c.resetObjIterator();

      while (c.objectIterator().hasNext()) {
        if (c.objectIterator().next() instanceof Jar) {
          jarCounter++;
        }
      }
    }
  }
예제 #2
0
  public boolean allJarsOnMarks() {

    int jars = 0;
    GameObject obj;

    for (Cell c : cells) {
      c.resetObjIterator();

      while (c.objectIterator().hasNext()) {
        if ((obj = c.objectIterator().next()) instanceof Mark) {
          jars += ((Mark) obj).getJarCounter();
        }
      }
    }

    if (jars >= jarCounter) {
      return true;
    }
    return false;
  }