public Recipe(string name, Course course, CookingTechnique technique, Ingredient[] ingredients)
 {
     Name         = name;
     Course       = course;
     Technique    = technique;
     _ingredients = ingredients;
 }
    void Awake()
    {
        ModuleId = ModuleIdCounter++;

        IsSolved = false;

        for (int i = 0; i < TechniqueButtons.Length; i++)
        {
            KMSelectable     button    = TechniqueButtons[i];
            CookingTechnique technique = (CookingTechnique)i;
            button.OnInteract += delegate { OnTechniqueButtonPressed(technique, button); return(false); };
        }

        LeftButton.OnInteract  += delegate { OnArrowButtonPressed(-1, LeftButton); return(false); };
        RightButton.OnInteract += delegate { OnArrowButtonPressed(1, RightButton); return(false); };

        AddButton.OnInteract   += delegate { OnAddButtonPressed(); return(false); };
        ResetButton.OnInteract += delegate { OnResetButtonPressed(); return(false); };
    }
        public static string ToExtendedString(this CookingTechnique technique)
        {
            switch (technique)
            {
            case CookingTechnique.Egg:
                return("Cracking an egg");

            case CookingTechnique.Fire:
                return("The perfect flambé");

            case CookingTechnique.Knife:
                return("Good knife skills");

            case CookingTechnique.Pepper:
                return("Seasoning with style");

            default:
                return(technique.ToString());
            }
        }
    void OnTechniqueButtonPressed(CookingTechnique technique, KMSelectable source)
    {
        source.AddInteractionPunch(0.5f);

        if (IsSolved)
        {
            return;
        }

        var time = BombInfo.GetFormattedTime();

        ModuleLog("Pressed {0} at time {1}", technique, time);

        if (!AddedIngredients.SetEquals(new HashSet <Ingredient>(SelectedRecipe.Ingredients)))
        {
            ModuleLog("Strike!  The ingredients are incorrect.");
            BombModule.HandleStrike();
        }
        else if (SelectedRecipe.Technique != technique)
        {
            ModuleLog("Strike!  The selected technique is incorrect.");
            BombModule.HandleStrike();
        }
        else
        {
            char digit = (char)(48 + DigitLookupTable[SelectedRecipe.Technique][SelectedRecipe.Course]);
            if (time.Contains(digit))
            {
                Audio.PlaySoundAtTransform("solved", transform);
                ModuleLog("Delicious!  Module disarmed.");
                IsSolved = true;
                BombModule.HandlePass();
            }
            else
            {
                ModuleLog("Strike!  The timer does not contain the required digit.");
                BombModule.HandleStrike();
            }
        }
    }