Exemple #1
0
 public bool CanRotate(TetrisBoard board)
 {
     // Check if empty for each child
     foreach (Point p in RotatedPoints())
     {
         if (!board.IsEmpty(Position + p))
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #2
0
        public bool CanMove(TetrisBoard board, Point direction)
        {
            // Check if empty for each child
            foreach (Entity e in Shape)
            {
                Point target = direction + Position + e.Position;

                if (!board.IsEmpty(direction + Position + e.Position))
                {
                    return(false);
                }
            }

            return(true);
        }