Ejemplo n.º 1
0
        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());
         }
     }
 }
Ejemplo n.º 3
0
 public void Add(GameCurrency currency, int amount)
 {
     map[currency].Value += amount;
 }
Ejemplo n.º 4
0
 public void AddFromBuffer(GameCurrency currency)
 {
     map[currency].Value += buffers[currency].Value;
 }
Ejemplo n.º 5
0
 public void MultiplyBuffer(GameCurrency currency, int multiplier)
 {
     buffers[currency].Value *= multiplier;
 }
Ejemplo n.º 6
0
 public void SetBuffer(GameCurrency currency, int amount)
 {
     buffers[currency].Value = amount;
 }
Ejemplo n.º 7
0
 public CurrencyValue(bool isPersistent, GameCurrency currency, System.Action <GameCurrency, int> onSetValue)
 {
     this.isPersistent = isPersistent;
     this.currency     = currency;
     this.onSetValue   = onSetValue;
 }
Ejemplo n.º 8
0
 public bool IsEnough(GameCurrency currency, int price)
 {
     return(map[currency].Value >= price);
 }
Ejemplo n.º 9
0
 public void Spend(GameCurrency currency, int amount)
 {
     map[currency].Value -= amount;
 }