public bool Place(Tetromono polyomino) { Contract.Assert(polyomino.Size.Width <= Size.Width && polyomino.Size.Height <= Size.Height); Clear(); var position = new Point<int>().Add(Size.Subtract(polyomino.Size).Divide(2)); var cellsClone = CellsClone; if (polyomino.Place(cellsClone, position)) { CellsClone = cellsClone; return true; } return false; }
bool Place(Tetromono polyomino) { var position = new Point <int> { X = (Size.Width - polyomino.Size.Width) / 2, Y = 0 }; var cellsClone = CellsClone; if (polyomino.Place(cellsClone, position)) { CellsClone = cellsClone; return(true); } return(false); }
public bool Place(Tetromono polyomino) { Contract.Assert(polyomino.Size.Width <= Size.Width && polyomino.Size.Height <= Size.Height); Clear(); var position = new Point <int>().Add(Size.Subtract(polyomino.Size).Divide(2)); var cellsClone = CellsClone; if (polyomino.Place(cellsClone, position)) { CellsClone = cellsClone; return(true); } return(false); }
bool Place(Tetromono polyomino) { var position = new Point<int> { X = (Size.Width - polyomino.Size.Width) / 2, Y = 0 }; var cellsClone = CellsClone; if (polyomino.Place(cellsClone, position)) { CellsClone = cellsClone; return true; } return false; }