Ejemplo n.º 1
0
 private static void RemoveEntityIfInList(DrawableEntity entity,
                                          SortedDrawBehaviors sortedBehavior)
 {
     foreach (var behavior in entity.drawBehaviors)
     {
         if (sortedBehavior.behaviors.Keys.Contains(behavior))
         {
             sortedBehavior.behaviors[behavior].Remove(entity);
         }
     }
 }
Ejemplo n.º 2
0
        private SortedDrawBehaviors FindSpotOrCreateOne(int renderLayer)
        {
            var sortedList = renderLayer < 0 ? negativeSortedDrawEntities : positiveSortedDrawEntities;
            int index      = 0;

            for (; index < sortedList.Count; index++)
            {
                var layer = sortedList[index];
                if (layer.RenderLayer == renderLayer)
                {
                    return(layer);
                }
                if (layer.RenderLayer > renderLayer)
                {
                    break;
                }
            }             // ncrunch: no coverage
            var newList = new SortedDrawBehaviors(renderLayer);

            sortedList.Insert(index, newList);
            return(newList);
        }