コード例 #1
0
        public static MovingTetromino CreateMovingTetromino(TetrisGameBoard gameBoard, BrickType brick)
        {
            MovingTetromino inst = null;

            switch (brick)
            {
            case BrickType.J:
            {
                inst = new MovingTetrominoJ(gameBoard);
                break;
            }

            case BrickType.L:
            {
                inst = new MovingTetrominoL(gameBoard);
                break;
            }

            case BrickType.O:
            {
                inst = new MovingTetrominoO(gameBoard);
                break;
            }

            case BrickType.S:
            {
                inst = new MovingTetrominoS(gameBoard);
                break;
            }

            case BrickType.T:
            {
                inst = new MovingTetrominoT(gameBoard);
                break;
            }

            case BrickType.Z:
            {
                inst = new MovingTetrominoZ(gameBoard);
                break;
            }

            default:
            case BrickType.I:
            {
                inst = new MovingTetrominoI(gameBoard);
                break;
            }
            }
            inst.InitializeDescriptiveGrid();
            return(inst);
        }
コード例 #2
0
 public static MovingTetromino CreateMovingTetromino(TetrisGameBoard gameBoard, BrickType brick)
 {
     MovingTetromino inst = null;
     switch(brick)
     {
         case BrickType.J:
             {
                 inst = new MovingTetrominoJ(gameBoard);
                 break;
             }
         case BrickType.L:
             {
                 inst = new MovingTetrominoL(gameBoard);
                 break;
             }
         case BrickType.O:
             {
                 inst = new MovingTetrominoO(gameBoard);
                 break;
             }
         case BrickType.S:
             {
                 inst = new MovingTetrominoS(gameBoard);
                 break;
             }
         case BrickType.T:
             {
                 inst = new MovingTetrominoT(gameBoard);
                 break;
             }
         case BrickType.Z:
             {
                 inst = new MovingTetrominoZ(gameBoard);
                 break;
             }
         default:
         case BrickType.I:
             {
                 inst = new MovingTetrominoI(gameBoard);
                 break;
             }
     }
     inst.InitializeDescriptiveGrid();
     return inst;
 }