Esempio n. 1
0
        public static List<String> FindUnfilledResourceRequirments(Cell Cell, Task Task)
        {
            var taskRequirements = Task.GetRequiredResources().ToList();
            var cellResources = Cell.Resources;

            foreach (var item in cellResources)
                if (taskRequirements.Contains(item))
                    taskRequirements.Remove(item);

            return taskRequirements;
        }
Esempio n. 2
0
        public static List<String> FindExcessResources(Cell Cell, Task Task)
        {
            var taskRequirements = Task.GetRequiredResources();
            var cellResources = new List<String>(Cell.Resources);

            foreach (var item in taskRequirements)
                if (cellResources.Contains(item))
                    cellResources.Remove(item);

            return cellResources;
        }
Esempio n. 3
0
        public static bool ResourceRequirmentsMet(Cell Cell, Task Task)
        {
            var taskRequirements = Task.GetRequiredResources();
            var cellResources = Cell.Resources;

            if (taskRequirements.Count() != cellResources.Count) return false;

            var compared = taskRequirements.OrderBy(b => b).Zip(cellResources.OrderBy(b => b), (a, b) => a == b);
            if (compared.Count(b => b == false) != 0) return false;

            return true;
        }