Exemplo n.º 1
0
    //射击指令比较复杂,单独使用一个函数处理
    void ExecuteFireInstruction(Instruction instruction)
    {
        switch (instruction.fireType)
        {
        case FireType.BUBBLE:
            shotController.FireBubbleBullets(instruction.bulletsCount);
            break;

        case FireType.LAZER:
            shotController.FireLazerBullets(instruction.countOfWaves);
            break;

        case FireType.ARC_FORMATION:
            shotController.FireArcFormationBullet(instruction.bulletsCount, instruction.unitAngle, instruction.countOfWaves);
            break;

        case FireType.RIGHT_FORMATION:
            shotController.FireRightAngleBullets(instruction.countOfWaves);
            break;

        case FireType.MISSILE:
            shotController.FireMissile();
            break;
        }
    }