public void Consume(CurrencyCreated @event) { var currency = new GameCurrency { Code = @event.Code }; _repository.Currencies.Add(currency); _repository.SaveChanges(); }
public void DisplayBufferCurrency(GameCurrency currency, int value) { if (bufferCurrencyTexts.ContainsKey(currency)) { foreach (var text in bufferCurrencyTexts[currency]) { text.SetText(value.ToString()); } } }
public void Add(GameCurrency currency, int amount) { map[currency].Value += amount; }
public void AddFromBuffer(GameCurrency currency) { map[currency].Value += buffers[currency].Value; }
public void MultiplyBuffer(GameCurrency currency, int multiplier) { buffers[currency].Value *= multiplier; }
public void SetBuffer(GameCurrency currency, int amount) { buffers[currency].Value = amount; }
public CurrencyValue(bool isPersistent, GameCurrency currency, System.Action <GameCurrency, int> onSetValue) { this.isPersistent = isPersistent; this.currency = currency; this.onSetValue = onSetValue; }
public bool IsEnough(GameCurrency currency, int price) { return(map[currency].Value >= price); }
public void Spend(GameCurrency currency, int amount) { map[currency].Value -= amount; }