Pathfinding.IntRect.Expand C# (CSharp) Method

Expand() public method

public Expand ( int range ) : IntRect
range int
return IntRect
        public IntRect Expand(int range)
        {
            return new IntRect(xmin-range,
                               ymin-range,
                               xmax+range,
                               ymax+range
                               );
        }

Usage Example

Beispiel #1
0
        public void RecalculateConnections(QuadtreeNodeHolder holder, int depth, int x, int y)
        {
            if (this.root == null)
            {
                throw new InvalidOperationException("Graph contains no nodes");
            }
            if (holder.node == null)
            {
                throw new ArgumentException("No leaf node specified. Holder has no node.");
            }
            int num = 1 << Math.Min(this.editorHeightLog2, this.editorWidthLog2) - depth;
            List <QuadtreeNode> list     = new List <QuadtreeNode>();
            List <QuadtreeNode> arg_75_1 = list;
            QuadtreeNodeHolder  arg_75_2 = this.root;
            int     arg_75_3             = 0;
            int     arg_75_4             = 0;
            int     arg_75_5             = 0;
            IntRect intRect = new IntRect(x, y, x + num, y + num);

            this.AddNeighboursRec(arg_75_1, arg_75_2, arg_75_3, arg_75_4, arg_75_5, intRect.Expand(0), holder.node);
            holder.node.connections     = list.ToArray();
            holder.node.connectionCosts = new uint[list.Count];
            for (int i = 0; i < list.Count; i++)
            {
                uint costMagnitude = (uint)(list[i].position - holder.node.position).costMagnitude;
                holder.node.connectionCosts[i] = costMagnitude;
            }
        }
All Usage Examples Of Pathfinding.IntRect::Expand