Exemplo n.º 1
0
 public DrawSlot(SceneItem ITEM, bool DRAWING)
 {
     drawing             = DRAWING;
     id                  = ITEM.drawLocId;
     item                = ITEM;
     item.DrawManagerDel = new PassObject(UpdateDetails);
 }
Exemplo n.º 2
0
        public virtual void Remove(SceneItem ITEM)
        {
            ITEM.drawLocId = 0;

            for (int i = 0; i < drawables.Count; i++)
            {
                if (drawables[i].item.drawLocId == ITEM.drawLocId)
                {
                    drawables.RemoveAt(i);
                }
            }
        }
Exemplo n.º 3
0
 public virtual void AddOrUpdateDraws(SceneItem ITEM, bool DRAWABLE)
 {
     if (ITEM.drawLocId == 0 || !SearchForItemById(ITEM.drawLocId))
     {
         bool add = true;
         for (int i = 0; i < drawables.Count; i++)
         {
             if (drawables[i].item == ITEM)
             {
                 add = false;
             }
         }
         if (add)
         {
             InsertItemByPos(ITEM, DRAWABLE);
         }
     }
     else
     {
     }
 }
Exemplo n.º 4
0
        public virtual void InsertItemByPos(SceneItem ITEM, bool DRAWABLE)
        {
            ITEM.drawLocId = GetNextID();

            bool added = false;

            for (int i = 0; i < drawables.Count; i++)
            {
                if (drawables[i].item.SortDrawPos.Y >= ITEM.SortDrawPos.Y || (drawables[i].item.drawLayer > ITEM.drawLayer && drawables[i].item.SortDrawPos.Y == ITEM.SortDrawPos.Y))
                {
                    drawables.Insert(Math.Max(0, i - 1), new DrawSlot(ITEM, DRAWABLE));
                    added = true;
                    break;
                }
            }

            if (!added)
            {
                drawables.Add(new DrawSlot(ITEM, DRAWABLE));
            }
        }