AStarCollisionMap.QuadTree.Quad.Search C# (CSharp) Метод

Search() публичный Метод

Attempts to search a quad that contains the given point
public Search ( Point p ) : Quad
p Point The point to search for
Результат Quad
        public Quad Search(Point p)
        {
            if (this.children == null)
            {
                if (this.rectangle.Contains(p)) return this;
                else return null;
            }
            foreach (Quad child in children)
            {
                if (child.rectangle.Contains(p))
                {
                    return child.Search(p);
                }
            }
            // Should never be called, but just in case ..
            return null;
        }