コード例 #1
0
 static public ShortRange GetExpanded(this ShortRange item, short value)
 {
     return(new ShortRange(
                item.x1.Min(value),
                item.x2.Max(value)
                ));
 }
コード例 #2
0
 static public bool IsBoundBetween(this short item, ShortRange range)
 {
     return(item.IsBoundBetween(range.x1, range.x2));
 }
コード例 #3
0
 static public short BindBetween(this short item, ShortRange range)
 {
     return(item.BindBetween(range.x1, range.x2));
 }
コード例 #4
0
 static public ShortRange GetFlipped(this ShortRange item)
 {
     return(new ShortRange(item.x2, item.x1));
 }
コード例 #5
0
 static public ShortVariance GetVariance(this ShortRange item)
 {
     return(new ShortVariance(item.GetCenter(), item.GetRadius()));
 }
コード例 #6
0
 static public short GetWidth(this ShortRange item)
 {
     return((short)(item.x2 - item.x1));
 }
コード例 #7
0
 static public short GetRadius(this ShortRange item)
 {
     return((short)(item.GetWidth() / 2));
 }
コード例 #8
0
 static public short GetCenter(this ShortRange item)
 {
     return((short)((item.x1 + item.x2) / 2));
 }