Exemple #1
0
    /// <summary>
    /// コマンド実行
    /// </summary>
    public override void ExecuteCommand(PlayerController.CommandData command)
    {
        switch ((PlayerController.CommandType)command.type)
        {
        case PlayerController.CommandType.TR_Move:
            if (command.values != null)
            {
                (Game as TRGame).PlayArea.MoveTetromino(new Vector2i(command.values[0], command.values[1]));
            }
            break;

        case PlayerController.CommandType.TR_Rotate:
            if (command.values != null)
            {
                (Game as TRGame).PlayArea.RotateTetromino(command.values[0] == 1);
            }
            break;

        case PlayerController.CommandType.TR_Hold:
            (Game as TRGame).PlayArea.Hold();
            break;
        }

        // ダメージ
        DamageTable.DamageData damage = GetDamageData((PlayerController.DamageType)command.damageType, command.damageValue);
        if (damage != null)
        {
            (Game as TRGame).PlayArea.RequestAddLine((int)damage.TRLine);
        }
    }
Exemple #2
0
    /// <summary>
    /// コマンド実行
    /// </summary>
    public override void ExecuteCommand(PlayerController.CommandData command)
    {
        PPPlayArea playArea = (Game as PPGame).PlayArea;

        switch ((PlayerController.CommandType)command.type)
        {
        case PlayerController.CommandType.PP_Swap:
            if (command.values != null)
            {
                Vector2i     grid   = new Vector2i(command.values[0] % PPGame.Config.PlayAreaWidth, command.values[0] / PPGame.Config.PlayAreaWidth);
                PPPanelBlock result = playArea.SwapPanel(playArea.GetBlock(grid), (PlayAreaBlock.Dir)command.values[1]);
                if (result != null)
                {
                    m_TouchedBlock = result;
                }
            }
            break;

        case PlayerController.CommandType.PP_Add:
            playArea.ElevateValue       = PPGame.Config.ManualElevateSpeed;
            playArea.MaxElevateWaitTime = PPGame.Config.ManualElevateInterval;
            playArea.SkipElevateWait();
            break;
        }

        // ダメージ
        DamageTable.DamageData damage = GetDamageData((PlayerController.DamageType)command.damageType, command.damageValue);
        if (damage != null)
        {
            foreach (var disturbData in damage.PPDisturb)
            {
                for (int i = 0; i < disturbData.count; i++)
                {
                    (Game as PPGame).PlayArea.CreateDisturbPanel(disturbData.width, disturbData.height);
                }
            }
        }
    }
Exemple #3
0
    /// <summary>
    /// コマンド実行
    /// </summary>
    public override void ExecuteCommand(PlayerController.CommandData command)
    {
        switch ((PlayerController.CommandType)command.type)
        {
        case PlayerController.CommandType.MD_Push:
            if (command.values != null)
            {
                m_CurrentRow = command.values[0];
                UpdatePosition();
                (Game as MDGame).PlayArea.PushDrop(m_CurrentRow);
            }
            break;

        case PlayerController.CommandType.MD_Pull:
            if (command.values != null)
            {
                m_CurrentRow = command.values[0];
                UpdatePosition();
                (Game as MDGame).PlayArea.PullDrop(m_CurrentRow);
            }
            break;

        case PlayerController.CommandType.MD_Add:
            (Game as MDGame).PlayArea.AddNewLine();
            break;
        }

        // ダメージ
        DamageTable.DamageData damage = GetDamageData((PlayerController.DamageType)command.damageType, command.damageValue);
        if (damage != null)
        {
            for (int i = 0; i < (int)damage.MDLine; i++)
            {
                (Game as MDGame).PlayArea.AddNewLine();
            }
        }
    }