You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
899 B

  1. using System;
  2. using System.Collections.Generic;
  3. using SUISS.Core;
  4. using SUISSEngine;
  5. public class GoldItem : IPackEffect
  6. {
  7. public GoldItem(Dictionary<string, object> props)
  8. {
  9. this._amount = (decimal)((double)props["Amount"]);
  10. }
  11. public GoldItem(decimal amount)
  12. {
  13. this._amount = amount;
  14. }
  15. public decimal Amount
  16. {
  17. get
  18. {
  19. return this._amount;
  20. }
  21. }
  22. public void ApplyEffect()
  23. {
  24. SingletonMonobehaviour<CIGGameState>.Instance.EarnCurrencies(new Currencies("Gold", this._amount), null);
  25. }
  26. public static GoldItem FromStorage(Dictionary<string, object> dict)
  27. {
  28. return new GoldItem((decimal)dict["Amount"]);
  29. }
  30. public Dictionary<string, object> ToStorage()
  31. {
  32. return new Dictionary<string, object>
  33. {
  34. {
  35. "Amount",
  36. this.Amount
  37. }
  38. };
  39. }
  40. public const string AmountKey = "Amount";
  41. private decimal _amount;
  42. }