1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System.Collections.Generic;
- namespace Core.BattleReport
- {
- /// <summary>
- /// 战斗value数据模块
- /// </summary>
- public class BattleReportValueDataModule
- {
- public string name;
- public Dictionary<string, ReportFightValueData<float>> fightValueData_long =
- new Dictionary<string, ReportFightValueData<float>>();
- public void SetMax(string name, float value)
- {
- if (!fightValueData_long.ContainsKey(name))
- {
- fightValueData_long.Add(name, new ReportFightValueData<float>()
- {
- name = name,
- value = 0,
- maxValue = value
- });
- }
- else
- {
- fightValueData_long[name].maxValue = value;
- }
- }
- public void Add(string name, float value, bool isAdd = false)
- {
- if (!fightValueData_long.ContainsKey(name))
- {
- fightValueData_long.Add(name, new ReportFightValueData<float>()
- {
- name = name,
- value = value,
- maxValue = value
- });
- }
- else
- {
- if (isAdd)
- {
- fightValueData_long[name].value += value;
- }
- else
- {
- fightValueData_long[name].value = value;
- }
- }
- }
- }
- }
|