PieceDropped.java :  » Game » sysboard » condition » Java Open Source

Java Open Source » Game » sysboard 
sysboard » condition » PieceDropped.java
package condition;

import base.Engine;
import base.Piece;

public class PieceDropped extends Condition<Integer> {

  public PieceDropped(Engine engine, Piece piece, Integer minimum, Integer maximum) {
    super(engine, piece, minimum, maximum);
  }

  @Override
  public boolean evaluate() {
    int drops = this.getEngine().getStatistics().getDropCountByPiece(this.getPiece());
    
    return drops <= this.getMaximum() && drops >= this.getMinimum();
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.