Пример #1
0
 public IEnumerable <SimObject> DetectCollisions(SimObject collidingObject)
 {
     foreach (var simObject in GetSimObjectsCopy())
     {
         if (collidingObject != simObject && _collisionDetection.IsCollision(collidingObject, simObject))
         {
             yield return(simObject);
         }
     }
 }
Пример #2
0
        public IEnumerable <SimObject> DetectCollisions(SimObject collidingObject)
        {
            var collidingObjects = new List <SimObject>();

            foreach (var simObject in SimObjects)
            {
                if (collidingObject != simObject && _collisionDetection.IsCollision(collidingObject, simObject))
                {
                    yield return(simObject);
                }
            }
        }