Exemplo n.º 1
0
        /*
         * 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));
        }
Exemplo n.º 2
0
        /*
         * Removes a piece from the board
         */
        public void deletePiece(Piece p)
        {
            Position pos = p.getPosition();

            matrix[pos.getRow(), pos.getColumn()].Image = null;
        }
Exemplo n.º 3
0
        /*
         * Draws a piece in the board
         */
        public void drawPiece(Piece p)
        {
            Position pos = p.getPosition();

            matrix[pos.getRow(), pos.getColumn()].Image = p.getImage();
        }