Пример #1
0
 public virtual void ProduceEnergy(ResourcesStorage storage)
 {
     if (storage.SubtractProduct(Resource, ConsumedResources) is var subtractProduct && subtractProduct)
     {
         storage.StoreProducts(ProducedUnitType, ProducedUnit);
     }
 }
 public void ConsumeEnergy(ResourcesStorage storage)
 {
     storage.SubtractProduct(Resource, ConsumedEnergy);
 }