Descent.Model.Board.Board.PlaceFigure C# (CSharp) Method

PlaceFigure() public method

Places a figure at a specific point
public PlaceFigure ( Figure figure, Point point ) : void
figure Descent.Model.Player.Figure.Figure /// The figure that is placed ///
point Point /// The upper left corner of the figure ///
return void
        public void PlaceFigure(Figure figure, Point point)
        {
            Contract.Requires(figure != null);
            Contract.Requires(point.X >= 0 && point.Y >= 0 && point.X < Width && point.Y < Height);

            for (int x = point.X;
                 x < point.X + (figure.Orientation.Equals(Orientation.V) ? figure.Size.Width : figure.Size.Height);
                 x++)
            {
                for (int y = point.Y;
                     y < point.Y + (figure.Orientation.Equals(Orientation.V) ? figure.Size.Height : figure.Size.Width);
                     y++)
                {
                    board[x, y].Figure = figure;
                }
            }
            figuresOnBoard[figure] = point;
            boardChanged = true;
        }