/**
* Copyright 1999-2009 The Pegadi Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Event to inform listeners of a changed score in a game.
*
* @author HÃ¥vard Wigtil <havardw at pvv.org>
* @version $Revision$, $Date$
*/
package org.pegadi.games.tetris;
import java.util.EventObject;
public class ScoreEvent extends EventObject {
long score;
int level;
int lines;
/** Set to true if this score is final. */
boolean finalScore;
/**
* Create a new event.
*
* @param gameOver <code>true</code> if the game is done.
*/
public ScoreEvent(Object source, long score, int level,
int lines, boolean gameOver) {
super(source);
this.score = score;
this.level = level;
this.lines = lines;
this.finalScore = gameOver;
}
public ScoreEvent(Object source, long score, int level, int lines) {
this(source, score, level, lines, false);
}
public long getScore() {
return score;
}
public int getLevel() {
return level;
}
public int getLines() {
return lines;
}
/**
* Returns <code>true</code> if this is the final score.
*/
public boolean isFinal() {
return finalScore;
}
}