Пример #1
0
        /// <summary>
        /// Returns the <see cref="BoundaryKind"/> of the <see cref="Boundary{T}"/> at location d of the result of intersecting another <see cref="IIntervalSet{T}"/>
        /// with a <see cref="Boundary{T}"/> at d with an <see cref="IIntervalSet{T}"/> with this kind of <see cref="Boundary{T}"/> at d
        /// </summary>
        /// <returns></returns>
        public BoundaryKind Cross(BoundaryKind other)
        {
            BoundaryDirection crossDirection   = Direction & other.Direction;
            Inclusivity       crossInclusivity = Inclusivity & other.Inclusivity;

            if (crossDirection == BoundaryDirection.None && crossInclusivity == Inclusivity.Exclusive)
            {
                return(null);
            }
            return(new BoundaryKind(crossDirection, crossInclusivity));
        }
 public Pair(T v, Inclusivity i)
 {
     this.v = v;
     this.i = i;
 }
 public void IntersectWith(T min, Inclusivity minI, T max, Inclusivity maxI)
 {
     IntersectWith(new Range(new Pair(min, minI), new Pair(max, maxI)));
 }
 public NumericalValue(T min, Inclusivity minI, T max, Inclusivity maxI)
 {
     ranges = new SortedSet <Range>();
     ranges.Add(new Range(new Pair(min, minI), new Pair(max, maxI)));
 }
Пример #5
0
 /// <summary>
 /// Initializes a new <see cref="EndKind"/>
 /// </summary>
 /// <param name="inclusivity"></param>
 public EndKind(Inclusivity inclusivity) : base(BoundaryDirection.End, inclusivity)
 {
 }
Пример #6
0
 /// <summary>
 /// Initializes a new <see cref="Start{T}"/> based on a given <paramref name="location"/> and <paramref name="inclusivity"/>
 /// </summary>
 /// <param name="location"></param>
 /// <param name="inclusivity"></param>
 public Start(T location, Inclusivity inclusivity) : base(location, new StartKind(inclusivity))
 {
 }
Пример #7
0
 /// <summary>
 /// Initializes a new <see cref="End{T}"/> based on a given <paramref name="location"/> and <paramref name="inclusivity"/>
 /// </summary>
 /// <param name="location"></param>
 /// <param name="inclusivity"></param>
 public End(T location, Inclusivity inclusivity) : base(location, new EndKind(inclusivity))
 {
 }
 public FloatRangeAttribute(float min, float max, Inclusivity inclusivity)
 {
     m_Min         = min;
     m_Max         = max;
     m_Inclusivity = inclusivity;
 }
Пример #9
0
 /// <summary>
 /// Initializes a new <see cref="BoundaryKind"/> with a given <see cref="BoundaryDirection"/> and <see cref="Kind.Inclusivity"/>
 /// </summary>
 protected BoundaryKind(BoundaryDirection direction, Inclusivity inclusivity)
 {
     Direction   = direction;
     Inclusivity = inclusivity;
 }
Пример #10
0
 /// <summary>
 /// Initializes a new <see cref="StartKind"/>
 /// </summary>
 /// <param name="inclusivity"></param>
 public StartKind(Inclusivity inclusivity) : base(BoundaryDirection.Start, inclusivity)
 {
 }