public static Price operator -(Price _priceA, Price _priceB) { Price newPrice = new Price(_priceA.MetalCost - _priceB.MetalCost, _priceA.CrystalCost - _priceB.CrystalCost, _priceA.DeuteriumCost - _priceB.DeuteriumCost); // Subtract a and b and create new price object. Then return it return(newPrice); }
public static Price operator +(Price _priceA, Price _priceB) { Price newPrice = new Price(_priceA.MetalCost + _priceB.MetalCost, _priceA.CrystalCost + _priceB.CrystalCost, _priceA.DeuteriumCost + _priceB.DeuteriumCost); // Add a and b together and create a new price object. Then return it return(newPrice); }