NumericUtil.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using ET;
  2. namespace GFGGame
  3. {
  4. public class NumericUtil
  5. {
  6. public static int GetNumericTypeByItemId(int itemId)
  7. {
  8. switch (itemId)
  9. {
  10. case ConstItemID.EXP:
  11. return NumericType.Exp;
  12. case ConstItemID.POWER:
  13. return NumericType.Power;
  14. case ConstItemID.DAILY_LIVENESS:
  15. return NumericType.DailyLiveness;
  16. case ConstItemID.WEEKLY_LIVENESS:
  17. return NumericType.WeeklyLiveness;
  18. }
  19. return 0;
  20. }
  21. //通过数值类型获取道具Id
  22. public static int GetItemIdByNumericType(int numericType)
  23. {
  24. return numericType switch
  25. {
  26. NumericType.Exp => ConstItemID.EXP,
  27. NumericType.Power => ConstItemID.POWER,
  28. NumericType.DailyLiveness => ConstItemID.DAILY_LIVENESS,
  29. NumericType.WeeklyLiveness => ConstItemID.WEEKLY_LIVENESS,
  30. _ => 0
  31. };
  32. }
  33. public static int GetLeagueNumericTypeByItemId(int itemId)
  34. {
  35. switch (itemId)
  36. {
  37. case ConstItemID.LEAGUE_COIN:
  38. return LeagueNumericType.LeagueCoin;
  39. // case ConstItemID.LEAGUE_CONTRIBUTION:
  40. // return LeagueNumericType.LeagueCoin;
  41. // case ConstItemID.LEAGUE_CURRENCY:
  42. // return LeagueNumericType.LeagueCoin;
  43. }
  44. return 0;
  45. }
  46. }
  47. }