Ejemplo n.º 1
0
        private bool CheckMaterials()
        {
            //ConcurrentDictionary<BuildingMaterial, int> cont = currentBuilding.GetFull();
            SlotContainer buildingContainer = currentBuilding.GetSlotContainer();

            foreach (var requiredMaterial in currentBuilding.GetFull())
            {
                int requiredAmount = requiredMaterial.Value - buildingContainer.GetContent()[requiredMaterial.Key];
                if (requiredAmount != 0)
                {
                    currentMaterial = new KeyValuePair <BuildingMaterial, int>(
                        requiredMaterial.Key,
                        requiredMaterial.Value - buildingContainer.GetContent()[requiredMaterial.Key]);
                    return(AttributedSoftware.attributedRobot.MaterialContainer.CanTake(currentMaterial.Key, 1));
                }
            }
            return(true);
        }