Пример #1
0
    public void AddBehaviourAndSort(CoreMonoBeh beh)
    {
        //Safety check for overflow
        CheckForOverflowAndExpand();

        LoopUpdateSettings settings = GetLoopSettings(beh);

        //Just throw it somewhere if the queue is already marked for sorting.
        //A nice early-out for batched additions.
        if (NeedsSorting)
        {
            queue[m_UpperBound] = beh;
            m_UpperBound++;
            return;
        }
        else if (settings.UpdateOrder >= UpperUpdateQueueBound)
        {
            queue[m_UpperBound] = beh;
            m_UpperBound++;
            m_UpperUpdateQueueBound = settings.UpdateOrder;
        }
        else if (settings.UpdateOrder <= LowerUpdateQueueBound && m_LowerBound > -1)
        {
            queue[m_LowerBound] = beh;
            m_LowerBound--;
            m_LowerUpdateQueueBound = settings.UpdateOrder;
        }
        //It's somewhere inbetween or where we can't place legally. Mark it for sorting.
        else
        {
            queue[m_UpperBound] = beh;
            m_UpperBound++;
            NeedsSorting = true;
        }

        if (!HasEntries)
        {
            m_LowerUpdateQueueBound = m_UpperUpdateQueueBound;
            m_HasEntries            = true;
        }
    }
 public override void WriteLoopSettings(CoreMonoBeh beh, LoopUpdateSettings set)
 {
     beh.UM_SETTINGS_GAMEPLAYUPDATE = set;
 }
Пример #3
0
 public sealed override void WriteLoopSettings(CoreMonoBeh beh, LoopUpdateSettings set)
 {
     throw new Exception("A WorkerLoop abstract method has been called! You should not inherit from it!");
 }
 public override void CoreInitSetup()
 {
     UM_SETTINGS_UPDATE = new LoopUpdateSettings(33);
 }
Пример #5
0
 public override void CoreInitSetup()
 {
     UM_SETTINGS_UPDATE         = new LoopUpdateSettings(32, false, true);
     UM_SETTINGS_GAMEPLAYUPDATE = new LoopUpdateSettings(32, false, true);
 }
Пример #6
0
 public abstract void WriteLoopSettings(CoreMonoBeh beh, LoopUpdateSettings set);