public CurrencyData ChangeValue(CurrencyType currencyType, int amount, string source) { CurrencyData currencyData = this.CurrentAmounts.ChangeValue(currencyType, amount); if (currencyData == null) { return(null); } this.Transactions.Enqueue(new CurrencyTransaction { Type = currencyType, Amount = amount, Source = source, Time = DateTime.UtcNow }); while (this.Transactions.Count > 20) { this.Transactions.Dequeue(); } return(currencyData); }
public virtual void SetValue(CurrencyData newBalance) { this.CurrentAmounts.SetValue(newBalance); }
public bool CanAfford(CurrencyData cost) { return(this.CurrentAmounts.CanAfford(cost)); }