コード例 #1
0
        public void TestCanMoveDownNotOK04()
        {
            Tetromino  block = new Tetromino(4, 237483878, TetrominoType.Square);
            TetrisGame game  = new TetrisGame();

            Assert.IsFalse(block.CanMoveDown(game));
        }
コード例 #2
0
        public void TestCanMoveDownNotOK03()
        {
            Tetromino  block = new Tetromino(1, TetrisGame.NB_ROWS - 2, TetrominoType.Square);
            TetrisGame game  = new TetrisGame();

            Assert.IsFalse(block.CanMoveDown(game));
        }
コード例 #3
0
        public void TestCanMoveDownOK01( )
        {
            Tetromino  block = new Tetromino(7, 0, TetrominoType.Square);
            TetrisGame game  = new TetrisGame();

            Assert.IsTrue(block.CanMoveDown(game));
        }
コード例 #4
0
        public void TestCanMoveDownNotOK02( )
        {
            Tetromino  block = new Tetromino(1, TetrisGame.NB_ROWS - 3, TetrominoType.Square);
            TetrisGame game  = new TetrisGame( );

            game.FreezeContent(TetrisGame.NB_ROWS - 1, 1);
            Assert.IsFalse(block.CanMoveDown(game));
        }
コード例 #5
0
ファイル: TetrominoHandler.cs プロジェクト: A2shiyari/Tetris
        /// <summary>
        /// Sets the last move value in the result
        /// </summary>
        /// <param name="moveResult"></param>
        private void SetLastMove(ChangeResult moveResult)
        {
            if (moveResult == null)
            {
                return;
            }

            moveResult.LastMove = !current.CanMoveDown();
        }