soundvision/UnityProject/Assets/Scripts/PdConnection/PdArraySelector.cs

28 lines
614 B
C#
Raw Normal View History

2019-10-04 13:35:23 +00:00
namespace cylvester
{
2019-10-05 16:09:24 +00:00
public interface IPdArraySelector
2019-10-04 13:35:23 +00:00
{
int Selection { set; }
float[] SelectedArray { get; }
2019-10-04 13:35:23 +00:00
}
2019-10-05 16:09:24 +00:00
public class PdArraySelector : IPdArraySelector
2019-10-04 13:35:23 +00:00
{
private int selection_;
2019-10-05 16:09:24 +00:00
private readonly IPdArrayContainer arrayContainer_;
2019-10-04 13:35:23 +00:00
2019-10-05 16:09:24 +00:00
public PdArraySelector(IPdArrayContainer arrayContainer)
2019-10-04 13:35:23 +00:00
{
arrayContainer_ = arrayContainer;
}
public int Selection
{
set => selection_ = value;
}
public float[] SelectedArray => arrayContainer_[selection_].Data;
}
}