Esempio n. 1
0
        private void ApplyActions(float[] vectorAction)
        {
            // --------------------------------------------------------------------------------------------------------
            // Actions:
            //
            // vectorAction[0] == 0 - do nothing, engines are off
            // vectorAction[0] == 1 - BOTTOM MAIN engine is ON
            // vectorAction[0] == 2 - auxiliary TOP STOP engine is ON
            // vectorAction[0] == 3 - auxiliary TOP LEFT engine is ON
            // vectorAction[0] == 4 - auxiliary TOP RIGHT engine is ON
            // vectorAction[0] == 5 - auxiliary BOTTOM LEFT engine is ON
            // vectorAction[0] == 6 - auxiliary BOTTOM RIGHT engine is ON
            //
            // --------------------------------------------------------------------------------------------------------

            //Debug.LogFormat("{0}: {1}: Action: {2}", LOG_TAG, nameof(classHelper.ApplyActions), vectorAction[0]);

            switch (vectorAction[0]) // the first action branch
            {
            case 0:
                // do nothing, don't turn on engines
                break;

            case 1:
                // MAIN BOTTOM engine is ON
                rocketControl.ActivateMainBottomEngine();
                break;

            case 2:
                // auxiliary TOP STOP engine is ON
                rocketControl.ActivateStopTopEngine();
                break;

            case 3:
                // auxiliary TOP LEFT engine is ON
                rocketControl.ActivateAuxiliaryTopLeftEngine();
                break;

            case 4:
                // auxiliary TOP RIGHT engine is ON
                rocketControl.ActivateAuxiliaryTopRightEngine();
                break;

            case 5:
                // auxiliary LEFT BOTTOM engine is ON
                rocketControl.ActivateAuxiliaryBottomLeftEngine();
                break;

            case 6:
                // auxiliary RIGHT BOTTOM engine is ON
                rocketControl.ActivateAuxiliaryBottomRightEngine();
                break;

            default:
                Debug.LogErrorFormat("{0}: {1}: Unexpected Action: {2}", LOG_TAG, nameof(classHelper.ApplyActions), vectorAction[0]);
                break;
            }
        }