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

A small readonly struct used by the model flex system in the Editor. It holds a stack of floats and an array of controller values used when evaluating flex rules.

Native Interop
#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;
        }
    }