/**
* 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.
*/
/**
* This class represents a single tetris piece.
*
* @author HÃ¥vard Wigtil <havardw at pvv.org>
* @version $Revision$, $Date$
*/
package org.pegadi.games.tetris;
import java.awt.Image;
public class Brick {
Image tile;
FallingBlock oldblock;
/**
* Creates a new instance.
*
* @param tile The image to use for a singe brick tile.
* @param oldblock Provided for compability
*/
public Brick(Image tile, FallingBlock oldblock) {
this.tile = tile;
this.oldblock = oldblock;
}
/**
* Returns the tile used to draw this brick. This method is needed for
* compability with the old preview window, it should be removed as soon
* as a new preview system is in place.
*
* @return The tile.
*/
public Image getTile() {
return tile;
}
/**
* This method is needed for
* compability with the old preview window, it should be removed as soon
* as a new preview system is in place.
*/
public FallingBlock getFallingBlock() {
return oldblock;
}
/**
* Returns a representation of this object as a string.
*
* @return A description of this object.
*/
public String toString() {
return super.toString() + "{ type=" + oldblock.getType() + "}";
}
}