1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System.Collections.Generic;
- using XGame.Database;
- using XGame.Framework.Network;
- using static FL.Network.ActArtifactFumo;
- namespace FL.Network
- {
- public class ActArtifactFumoPushCtrl : MsgController<ActArtifactFumoPush>
- {
- protected override void OnProcess(ActArtifactFumoPush message, object context)
- {
- if (message.fumo != null)
- {
- //神器上5种元素类型的附魔数据
- var enchantMap = ArtifactData.Instance.EnchantDataMap;
- foreach (var item in message.fumo)
- {
- if (enchantMap.ContainsKey((EElementType)item.type))
- {
- enchantMap[(EElementType)item.type] = GetEnchantDataList(item.type, item.buwei);
- }
- else
- {
- enchantMap.Add((EElementType)item.type, GetEnchantDataList(item.type, item.buwei));
- }
- }
- }
- }
- private List<ArtifactEnchantParam> GetEnchantDataList(int elementType, List<ActArtifactBuWei> dataList)
- {
- var artifactEnchantList = new List<ArtifactEnchantParam>();
- foreach (var item in dataList)
- {
- var ArtifactEnchantParam = new ArtifactEnchantParam()
- {
- elementType = elementType,
- holePosition = item.bwId,
- elementId = item.elementId
- };
- artifactEnchantList.Add(ArtifactEnchantParam);
- }
- return artifactEnchantList;
- }
- }
- }
|