예제 #1
0
        /// <summary>
        /// Gets all objects close to the collidable object passed in parameter
        /// </summary>
        /// <returns>True if objects are available to test otherwise return false</returns>
        /// <param name='colliderToTest'>The object to test with the collection</param>
        /// <param name='testFunction'>A callback function</param>
        public bool TestCandidates(ICollidable2 colliderToTest, TestOneCallback testFunction)
        {
            bool hasCandidate = false;

            List <ICollidable2> candidates = GetCandidates(colliderToTest);

            foreach (ICollidable2 candidate in candidates)
            {
                testFunction(candidate);
                hasCandidate = true;
            }

            return(hasCandidate);
        }
예제 #2
0
        /// <summary>
        /// Gets all objects close to the collidable object passed in parameter
        /// </summary>
        /// <returns>True if objects are available to test otherwise return false</returns>
        /// <param name='colliderToTest'>The object to test with the collection</param>
        /// <param name='testFunction'>A callback function</param>
        public bool TestCandidates(ICollidable2 colliderToTest, TestOneCallback testFunction)
        {
            bool hasCandidate = false;

            List<ICollidable2> candidates = GetCandidates(colliderToTest);

            foreach (ICollidable2 candidate in candidates)
            {
                testFunction(candidate);
                hasCandidate = true;
            }

            return hasCandidate;
        }