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;
}