Пример #1
0
  @Override
  public void instanciate(Predicate predicate) {
    Block x = (Block) predicate.getC1();
    Block y = (Block) predicate.getC2();

    setC1(x);
    setC2(y);

    prePickedUp.setC1(x);
    preFree.setC1(y);
    preHeavier.setC1(y);
    preHeavier.setC2(x);

    remPickedUp.setC1(x);
    remFree.setC1(y);

    addOn.setC1(x);
    addOn.setC2(y);
  }
Пример #2
0
  @Override
  public void partiallyInstanciate(Predicate predicate) {
    Block x = (Block) predicate.getC1();
    Block y = (Block) predicate.getC2();

    if (getC1() == null && getC2() == null) // Not instanciated at all?
    {
      instanciate(predicate);
      return;
    }

    if (getC1() == null) {
      setC1(x);

      prePickedUp.setC1(x);
      preHeavier.setC2(x);

      remPickedUp.setC1(x);

      addOn.setC1(x);

    } else if (getC2() == null) {
      if (predicate instanceof Heavier) {
        this.setC2(x);

        preFree.setC1(x);
        preHeavier.setC1(x);

        remFree.setC1(x);

        addOn.setC2(x);
      } else {
        setC2(y);

        preFree.setC1(y);
        preHeavier.setC1(y);

        remFree.setC1(y);

        addOn.setC2(y);
      }
    }
  }