Esempio n. 1
0
        internal void DropUnchecked(int distance)
        {
            // let piece fall
            Piece.Fall(distance);
            Board.PlaceUnchecked(Piece);
            Pieces.Push(new Piece(Piece)); // we need to remember the dropped pieces for the landing height feature (heuristic)
            Piece = null;

            // remove lines
            int lines = Board.RemoveLines();

            Lines += lines;

            // calculate score
            Score += TetrisScore.GetSoftdropScore(distance);
            Score += TetrisScore.GetLineScore(lines, Level);

            if (NextPiece.HasValue)
            {
                Piece     = new Piece(NextPiece.Value);
                NextPiece = Tetriminos.GetRandom();
            }
        }
Esempio n. 2
0
 public bool FallAndLand(int distance)
 {
     return(FallAndLand(distance, Tetriminos.GetRandom()));
 }
Esempio n. 3
0
 // returns the fallen distance of the piece
 public int Drop()
 {
     return(Drop(Tetriminos.GetRandom()));
 }
Esempio n. 4
0
 public bool FallAndLand()
 {
     return(FallAndLand(Tetriminos.GetRandom()));
 }
Esempio n. 5
0
 public Piece() : this(Tetriminos.GetRandom())
 {
 }
Esempio n. 6
0
 public static IEnumerable <int> GetPossibleOrientations(this Tetrimino tetrimino)
 {
     return(Tetriminos.GetPossibleOrientations(tetrimino));
 }
Esempio n. 7
0
 public static double GetChance(this Tetrimino tetrimino)
 {
     return(Tetriminos.GetChance(tetrimino));
 }
Esempio n. 8
0
 public static IEnumerable <int> GetPossibleTranslations(this Tetrimino tetrimino, int orientation = 0)
 {
     return(Tetriminos.GetPossibleTranslations(tetrimino, orientation));
 }