/* * Checks whether two positions are the same */ public override bool Equals(object obj) { if (obj is Position) { Position p = obj as Position; return(p.getRow() == this.getRow() && p.getColumn() == this.getColumn()); } return(base.Equals(obj)); }
/* * Removes a piece from the board */ public void deletePiece(Piece p) { Position pos = p.getPosition(); matrix[pos.getRow(), pos.getColumn()].Image = null; }
/* * Draws a piece in the board */ public void drawPiece(Piece p) { Position pos = p.getPosition(); matrix[pos.getRow(), pos.getColumn()].Image = p.getImage(); }