Пример #1
0
        /// <summary>
        /// テトロミノを動かす。当たり判定は行わない。
        /// </summary>
        public void NextTetromino(Tetromino tetromino, Point pos, Moving move, bool rotateStop, out Tetromino nextTetromino, out Point nextPos)
        {
            nextPos       = new Point(pos.X, pos.Y);
            nextTetromino = tetromino.Clone();

            switch (move)
            {
            case Moving.Stop:
                break;

            case Moving.Fall:
                nextPos.Y += 1;        // 自然落下
                break;

            case Moving.Down:
                nextPos.Y += 1;
                break;

            case Moving.Left:
                nextPos.X -= 1;
                break;

            case Moving.Right:
                nextPos.X += 1;
                break;

            case Moving.Rotate:
                // 連続で回らないようにする
                if (!rotateStop)
                {
                    nextTetromino.NextRotatePattern();
                }
                break;

            default:
                throw new ArgumentException("Moving型の列挙が不十分です。");
            }
        }