Пример #1
0
 public bool Equals(Bounds2i other)
 {
     if (IsEmpty && other.IsEmpty)
     {
         return(true);
     }
     return(Min == other.Min && Max == other.Max);
 }
Пример #2
0
        public Bounds2i Intersect(Bounds2i b)
        {
            int x    = Math.Max(Min.X, b.Min.X);
            int num2 = Math.Min(Min.X + Size.X, b.Min.X + b.Size.X);
            int z    = Math.Max(Min.Z, b.Min.Z);
            int num4 = Math.Min(Min.Z + Size.Z, b.Min.Z + b.Size.Z);

            if ((num2 > x) && (num4 > z))
            {
                return(new Bounds2i(new Vector2i(x, z), num2 - x, num4 - z));
            }

            return(Empty);
        }
Пример #3
0
 public IEnumerable <Vector2i> Substract(Bounds2i b)
 {
     return(this.Where(v => !b.Contains(v)));
 }