soundvision/UnityProject/Assets/Scripts/PdConnection/Boundary.cs
Chikashi Miyama 0eec0a6e2f fix bug #124
2019-12-07 19:20:44 +01:00

30 lines
No EOL
614 B
C#

namespace cylvester
{
public class Boundary
{
private readonly double? min_;
private readonly double? max_;
public Boundary(double? min, double? max)
{
min_ = min;
max_ = max;
}
public bool IsInside(double value)
{
if (min_.HasValue)
{
if (value < min_.Value)
return false;
}
if (max_.HasValue)
{
if (value > max_.Value)
return false;
}
return true;
}
}
}