📄 doublerange.cs
字号:
namespace Imps.Client.Utils
{
using System;
public class DoubleRange
{
private double max;
private double min;
public DoubleRange(double min, double max)
{
this.min = min;
this.max = max;
}
public bool IsInside(DoubleRange range)
{
if (this.IsInside(range.min))
{
return this.IsInside(range.max);
}
return false;
}
public bool IsInside(double x)
{
if (x >= this.min)
{
return (x <= this.max);
}
return false;
}
public bool IsOverlapping(DoubleRange range)
{
if (!this.IsInside(range.min))
{
return this.IsInside(range.max);
}
return true;
}
public double Length
{
get
{
return (this.max - this.min);
}
}
public double Max
{
get
{
return this.max;
}
set
{
this.max = value;
}
}
public double Min
{
get
{
return this.min;
}
set
{
this.min = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -