package chess; /* * Square.java * * Created on February 10, 2007, 6:19 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ /** * * @author Stanislav Hromek */ public class Square { /** piece which contains the square */ private Piece piece; /** name of the square eg. A1 */ private String name; /** Creates a new instance of Square */ public Square(String name) { this.name = name; } /** sets the piece for this square */ void setPiece(Piece piece) { this.piece = piece; } /** returns the piece in this square, if no piece, returns null */ protected Piece getPiece(){ return piece; } protected String getName(){ return name; } boolean isEmpty(){ if(this.getPiece() == null) return true; else return false; } public String toString(){ return getName(); } }