XmdsGlobalData.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using CommonLang;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using XmdsCommonServer.XLS.Data;
  8. using XmdsCommonSkill.Plugin.CardSkill;
  9. namespace XmdsCommonServer.Plugin.Base
  10. {
  11. //技能相关全局信息
  12. public class XmdsGlobalData
  13. {
  14. public static readonly XmdsSkillValue DefaultValue = new XmdsSkillValue("", false);
  15. /// <summary>
  16. /// 技能天赋信息
  17. /// </summary>
  18. private static HashMap<int, XmdsSkillValue> mTalentInfo = new HashMap<int, XmdsSkillValue>();
  19. /** 技能破定值 */
  20. private static HashMap<int, int> mSkillBreakShieldValue = new HashMap<int, int>();
  21. //玩家天赋数据,重进游戏保存
  22. // private static HashMap<string, JSGPlayerCardModule> mPlayerCardModuleMaps = new HashMap<string, JSGPlayerCardModule>();
  23. public static void PutTalentData(int skillID, XmdsSkillValue data)
  24. {
  25. if(data.GetValue(1) > 0 || data.GetValue(2) > 0)
  26. {
  27. mTalentInfo.Put(skillID, data);
  28. }
  29. }
  30. public static XmdsSkillValue GetTalentData(int skillID)
  31. {
  32. XmdsSkillValue outData;
  33. mTalentInfo.TryGetValue(skillID, out outData);
  34. return (outData == null) ? DefaultValue : outData;
  35. }
  36. /** 记录技能破定信息 */
  37. public static void PutSkillBreakShieldValue(int skillId, int value)
  38. {
  39. mSkillBreakShieldValue.Put(skillId, value);
  40. }
  41. public static int GetSkillBreakShieldValue(int skillId)
  42. {
  43. return mSkillBreakShieldValue.Get(skillId);
  44. }
  45. // public static JSGPlayerCardModule GetPlayerCardModule(XmdsVirtual player)
  46. // {
  47. // if(player == null || string.IsNullOrEmpty(player.mUnit.PlayerUUID))
  48. // {
  49. // return null;
  50. // }
  51. //
  52. // JSGPlayerCardModule module = mPlayerCardModuleMaps.Get(player.mUnit.PlayerUUID);
  53. // if(module == null)
  54. // {
  55. // module = new JSGPlayerCardModule(player);
  56. // mPlayerCardModuleMaps.Put(player.mUnit.PlayerUUID, module);
  57. // }
  58. //
  59. // return module;
  60. // }
  61. }
  62. }