BattleReportValueDataModule.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections.Generic;
  2. namespace Core.BattleReport
  3. {
  4. /// <summary>
  5. /// 战斗value数据模块
  6. /// </summary>
  7. public class BattleReportValueDataModule
  8. {
  9. public string name;
  10. public Dictionary<string, ReportFightValueData<long>> fightValueData_long =
  11. new Dictionary<string, ReportFightValueData<long>>();
  12. public void SetMax(string name, long value)
  13. {
  14. if (!fightValueData_long.ContainsKey(name))
  15. {
  16. fightValueData_long.Add(name, new ReportFightValueData<long>()
  17. {
  18. name = name,
  19. value = 0,
  20. maxValue = value
  21. });
  22. }
  23. else
  24. {
  25. fightValueData_long[name].maxValue = value;
  26. }
  27. }
  28. public void Add(string name, long value)
  29. {
  30. if (!fightValueData_long.ContainsKey(name))
  31. {
  32. fightValueData_long.Add(name, new ReportFightValueData<long>()
  33. {
  34. name = name,
  35. value = value,
  36. maxValue = value
  37. });
  38. }
  39. else
  40. {
  41. fightValueData_long[name].value = value;
  42. }
  43. }
  44. }
  45. }