addFigure() public method

public addFigure ( Figure fig ) : void
fig Figure
return void
Example #1
0
        public Board Clone()
        {
            Board b     = new Board();

            b.setDimension(this.dimension);
            b.setHeuristic(this.heuristic);
            b.setContent("0000000000000000000000000000000000000000000000000000000000000000",
                         "0000000000000000000000000000000000000000000000000000000000000000");

            foreach (Figure fig in data)
            {
                if (fig == null || fig.getFigureType() == Figure.FigureType.Nothing)
                    continue;

                Figure clone = fig.Clone();
                fig.setBoard(b);
                b.addFigure(fig);
            }

            return b;
        }