public void PutItem(StandardItemType itemType, int count)
        {
            foreach (var component in _components)
            {
                if (component.Complete)
                {
                    continue;
                }

                if (component.ItemType != itemType)
                {
                    continue;
                }

                var countToTransfere = Math.Min(component.RemainingCount, count);
                count -= countToTransfere;

                component.ActualCount += countToTransfere;

                if (count == 0)
                {
                    return;
                }
            }
        }
示例#2
0
 public BlockBlueprintComponent(int count, StandardItemType itemType, float integrityValue)
 {
     Count          = count;
     ItemType       = itemType;
     IntegrityValue = integrityValue;
 }