using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace SimplifyXR
{

    [DirectiveCategory(DirectiveCategories.Action,
        subCategory = DirectiveSubCategory.UI,
        directiveInfo = "This <i>action</i> triggers a <b>multiple choice submission</b> of the current active multiple choice selection in the simpleAR Standard Instruction Panel.",
        prettyName = "Submit Instructional Multiple Choice")]
    public class SubmitMultipleChoiceAction : Actions
    {
        public simpleARInstructionFeatures instructionPanel;
        InstructionMultipleChoice multipleChoice;

        public override List<KnobKeywords> ReceiveKeywords()
        {
            return new List<KnobKeywords>();
        }

        public override List<KnobKeywords> SendKeywords()
        {
            return new List<KnobKeywords>();
        }

        public override void Execute()
        {
            instructionPanel =
                instructionPanel == null ?
                Object.FindObjectOfType<simpleARInstructionFeatures>() :
                instructionPanel;

            multipleChoice = instructionPanel?.GetComponentInChildren<InstructionMultipleChoice>();

            multipleChoice?.SubmitMultipleChoiceSelection();
            ThisActionCompleted();
        }
    }
}

