using UnityEngine; namespace TowerDefense.Economy { /// /// A struct for holding currency change data /// public struct CurrencyChangeInfo { /// /// The previous value of the currency /// public readonly int previousCurrency; /// /// The new value of the currency /// public readonly int currentCurrency; /// /// The difference in amount /// public readonly int difference; /// /// Gets the absolute difference in amount /// public readonly int absoluteDifference; /// /// Initializes the CurrencyChangeInfo /// /// /// The previous value of the currency /// /// /// The current value of the currency /// public CurrencyChangeInfo(int previous, int current) { previousCurrency = previous; currentCurrency = current; difference = currentCurrency - previousCurrency; absoluteDifference = Mathf.Abs(difference); } } }