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;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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;
 }