#nullable enable
using System;
namespace UVC.UIToolkit
{
///
/// 정수 속성 데이터 클래스입니다.
/// UI는 UTKIntPropertyItemView에서 담당합니다.
///
public class UTKIntPropertyItem : UTKPropertyItemBase
{
#region Fields
private bool _useSlider;
private bool _useStepper;
private int _minValue = int.MinValue;
private int _maxValue = int.MaxValue;
private int _step = 1;
#endregion
#region Properties
/// 속성 타입
public override UTKPropertyType PropertyType => UTKPropertyType.Int;
/// 슬라이더 사용 여부
public bool UseSlider
{
get => _useSlider;
set
{
_useSlider = value;
}
}
/// 스테퍼(증감 버튼) 사용 여부
public bool UseStepper
{
get => _useStepper;
set
{
_useStepper = value;
}
}
/// 스테퍼 증감 단위 (기본값: 1)
public int Step
{
get => _step;
set => _step = Math.Max(1, value);
}
/// 최소값 (슬라이더 모드)
public int MinValue
{
get => _minValue;
set => _minValue = value;
}
/// 최대값 (슬라이더 모드)
public int MaxValue
{
get => _maxValue;
set => _maxValue = value;
}
#endregion
#region Constructor
///
/// 정수 속성을 생성합니다 (필드 모드).
///
/// 고유 ID
/// 표시 이름
/// 초기 값
public UTKIntPropertyItem(string id, string name, int initialValue = 0)
: base(id, name, initialValue)
{
}
///
/// 정수 속성을 생성합니다 (슬라이더 모드).
///
/// 고유 ID
/// 표시 이름
/// 초기 값
/// 최소값
/// 최대값
/// 슬라이더 사용 여부
/// 읽기 전용 여부
/// 라벨 표시 여부
public UTKIntPropertyItem(string id, string name, int initialValue, int minValue, int maxValue, bool useSlider = false, bool useStepper = false, bool isReadOnly = false, bool showLabel = true)
: base(id, name, initialValue)
{
_minValue = minValue;
_maxValue = maxValue;
_useSlider = useSlider;
_useStepper = useStepper;
_isReadOnly = isReadOnly;
_showLabel = showLabel;
}
#endregion
}
}