Editor/Embedded/ValveResourceFormat/ResourceTypes/ModelFlex/FlexRuleContext.cs

Defines the FlexRuleContext struct used for evaluating flex rules within the Valve Resource Format model system. It stores controller values and a stack of floats required for rule evaluation.

#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using HumanoidRetargeter.EditorTools.Embedded.ValveResourceFormat.Utils;
namespace HumanoidRetargeter.EditorTools.Embedded.ValveResourceFormat.ResourceTypes.ModelFlex;

    /// <summary>
    /// Context for evaluating flex rules.
    /// </summary>
    public readonly struct FlexRuleContext
    {
        /// <summary>
        /// Gets the controller values.
        /// </summary>
        public float[] ControllerValues { get; }
        /// <summary>
        /// Gets the stack for flex operations.
        /// </summary>
        public Stack<float> Stack { get; }

        /// <summary>
        /// Initializes a new instance of the <see cref="FlexRuleContext"/> struct.
        /// </summary>
        public FlexRuleContext(Stack<float> stack, float[] controllerValues)
        {
            ControllerValues = controllerValues;
            Stack = stack;
        }
    }