Package com.jcloisterzone.feature.visitor

Source Code of com.jcloisterzone.feature.visitor.IsOccupiedOrCompleted

package com.jcloisterzone.feature.visitor;

import com.jcloisterzone.feature.Completable;
import com.jcloisterzone.feature.Feature;

public class IsOccupiedOrCompleted extends IsOccupied {
 
  private boolean isCompleted = true;
 
  @Override
  public boolean visit(Feature feature) {   
    Completable completable = (Completable) feature;
    if (completable.isOpen()) {
      isCompleted = false;
    }   
    return super.visit(feature);
  }
 
  @Override
  public Boolean getResult() {   
    return isCompleted || super.getResult();
  }
}
TOP

Related Classes of com.jcloisterzone.feature.visitor.IsOccupiedOrCompleted

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.