Represents a model facial animation flex controller. Stores a controller name and its min/max float range, and validates that the provided type string equals "default" or throws NotImplementedException.
#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>
/// Represents a flex controller for model facial animation.
/// </summary>
public class FlexController
{
/// <summary>
/// Gets the name of the flex controller.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets the minimum value of the flex controller.
/// </summary>
public float Min { get; private set; }
/// <summary>
/// Gets the maximum value of the flex controller.
/// </summary>
public float Max { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="FlexController"/> class.
/// </summary>
public FlexController(string name, string type, float min, float max)
{
if (type != "default")
{
throw new NotImplementedException($"Unknown FlexController type: {type}");
}
Name = name;
Min = min;
Max = max;
}
}