Pathfinding.IntRect.IsValid C# (CSharp) Method

IsValid() public method

public IsValid ( ) : bool
return bool
        public bool IsValid()
        {
            return xmin <= xmax && ymin <= ymax;
        }

Usage Example

Example #1
0
        protected override List <GraphNode> GetNodesInRegion(Bounds b, GraphUpdateShape shape)
        {
            IntRect rectFromBounds = base.GetRectFromBounds(b);

            if (this.nodes == null || !rectFromBounds.IsValid() || this.nodes.Length != this.width * this.depth * this.layerCount)
            {
                return(ListPool <GraphNode> .Claim());
            }
            List <GraphNode> list = ListPool <GraphNode> .Claim(rectFromBounds.Width *rectFromBounds.Height *this.layerCount);

            for (int i = 0; i < this.layerCount; i++)
            {
                int num = i * this.width * this.depth;
                for (int j = rectFromBounds.xmin; j <= rectFromBounds.xmax; j++)
                {
                    for (int k = rectFromBounds.ymin; k <= rectFromBounds.ymax; k++)
                    {
                        int       num2      = num + k * this.width + j;
                        GraphNode graphNode = this.nodes[num2];
                        if (graphNode != null && b.Contains((Vector3)graphNode.position) && (shape == null || shape.Contains((Vector3)graphNode.position)))
                        {
                            list.Add(graphNode);
                        }
                    }
                }
            }
            return(list);
        }
All Usage Examples Of Pathfinding.IntRect::IsValid