ActArtifactFumoPushCtrl.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Collections.Generic;
  2. using XGame.Database;
  3. using XGame.Framework.Network;
  4. using static FL.Network.ActArtifactFumo;
  5. namespace FL.Network
  6. {
  7. public class ActArtifactFumoPushCtrl : MsgController<ActArtifactFumoPush>
  8. {
  9. protected override void OnProcess(ActArtifactFumoPush message, object context)
  10. {
  11. if (message.fumo != null)
  12. {
  13. //神器上5种元素类型的附魔数据
  14. var enchantMap = ArtifactData.Instance.EnchantDataMap;
  15. foreach (var item in message.fumo)
  16. {
  17. if (enchantMap.ContainsKey((EElementType)item.type))
  18. {
  19. enchantMap[(EElementType)item.type] = GetEnchantDataList(item.type, item.buwei);
  20. }
  21. else
  22. {
  23. enchantMap.Add((EElementType)item.type, GetEnchantDataList(item.type, item.buwei));
  24. }
  25. }
  26. }
  27. }
  28. private List<ArtifactEnchantParam> GetEnchantDataList(int elementType, List<ActArtifactBuWei> dataList)
  29. {
  30. var artifactEnchantList = new List<ArtifactEnchantParam>();
  31. foreach (var item in dataList)
  32. {
  33. var ArtifactEnchantParam = new ArtifactEnchantParam()
  34. {
  35. elementType = elementType,
  36. holePosition = item.bwId,
  37. elementId = item.elementId
  38. };
  39. artifactEnchantList.Add(ArtifactEnchantParam);
  40. }
  41. return artifactEnchantList;
  42. }
  43. }
  44. }