Esempio n. 1
0
        public void RemoveTask(ACBudgetedTask t)
        {
            // Make Sure Task Has Been Added
            if (t.CurrentBin < 0)
            {
                return;
            }

            TotalTasks--;
            totalWork[t.CurrentBin] -= t.WorkAmount;
            taskBins[t.CurrentBin].Remove(t);
            t.CurrentBin = -1;
        }
Esempio n. 2
0
        public void AddTask(ACBudgetedTask t)
        {
            // Make Sure Task Hasn't Already Been Added
            if (t.CurrentBin >= 0)
            {
                RemoveTask(t);
            }

            int bin = FindEasiestBin();

            t.CurrentBin = bin;
            taskBins[bin].Add(t);
            totalWork[bin] += t.WorkAmount;
            TotalTasks++;
        }
Esempio n. 3
0
        public void ResortBins()
        {
            ACBudgetedTask[] tasks = new ACBudgetedTask[TotalTasks];
            int c = 0;

            for (int bin = 0; bin < taskBins.Length; bin++)
            {
                for (int ti = 0; ti < taskBins[bin].Count; ti++)
                {
                    // Check For Finished Tasks
                    if (!taskBins[bin][ti].IsFinished)
                    {
                        tasks[c++] = taskBins[bin][ti];
                    }
                }
            }

            // Re-Add Tasks
            ClearTasks();
            for (int i = 0; i < c; i++)
            {
                AddTask(tasks[i]);
            }
        }
Esempio n. 4
0
        public void ResortBins()
        {
            ACBudgetedTask[] tasks = new ACBudgetedTask[TotalTasks];
            int c = 0;
            for(int bin = 0; bin < taskBins.Length; bin++)
                for(int ti = 0; ti < taskBins[bin].Count; ti++)
                    // Check For Finished Tasks
                    if(!taskBins[bin][ti].IsFinished)
                        tasks[c++] = taskBins[bin][ti];

            // Re-Add Tasks
            ClearTasks();
            for(int i = 0; i < c; i++) AddTask(tasks[i]);
        }
Esempio n. 5
0
        public void RemoveTask(ACBudgetedTask t)
        {
            // Make Sure Task Has Been Added
            if(t.CurrentBin < 0) return;

            TotalTasks--;
            totalWork[t.CurrentBin] -= t.WorkAmount;
            taskBins[t.CurrentBin].Remove(t);
            t.CurrentBin = -1;
        }
Esempio n. 6
0
        public void AddTask(ACBudgetedTask t)
        {
            // Make Sure Task Hasn't Already Been Added
            if(t.CurrentBin >= 0) RemoveTask(t);

            int bin = FindEasiestBin();
            t.CurrentBin = bin;
            taskBins[bin].Add(t);
            totalWork[bin] += t.WorkAmount;
            TotalTasks++;
        }