using System.Collections.Generic; using System.Linq; public class RegisterSpellboost : RegisterAlter { private int _addValue; private int _deffSet; private readonly string SpellboostParameter = "spellboost"; public List SpellBoostIndexList { get; private set; } public List SpellBoostGroupIndexList { get; private set; } public RegisterSpellboost(List cardList, SkillBase skill, int addCount, int deffSet) : base(cardList, skill) { base.IndexList = new List(); if (cardList != null && cardList.Count > 0) { cardList.ForEach(delegate(BattleCardBase x) { if (!base.IndexList.Any((int z) => z == x.Index)) { base.IndexList.Add(x.Index); } }); } _addValue = addCount; _deffSet = deffSet; IsSelf = skill.SkillPrm.ownerCard.IsPlayer; SpellBoostGroupIndexList = new List(); SpellBoostIndexList = new List(); } public override Dictionary MakeSendData() { Dictionary dictionary = new Dictionary(); if (SpellBoostGroupIndexList.Count > 0) { dictionary.Add(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.idx], SpellBoostGroupIndexList[0]); } else if (base.IndexList.Count > 0) { List list = new List(); foreach (int index in base.IndexList) { list.Add(index); } dictionary.Add(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.idx], list); } dictionary.Add(NetworkBattleDefine.NetworkParameterNames[NetworkBattleDefine.NetworkParameter.isSelf], IsSelf ? 1 : 0); dictionary.Add(ActionBaseParameter.type.ToString(), ActionBaseParameter.add.ToString()); if (_deffSet == 0) { dictionary.Add(SpellboostParameter, "a" + _addValue); } else { dictionary.Add(SpellboostParameter, "s" + _deffSet); } return MakeAttachTarget(dictionary); } public void SettingSpellBoostGrope(string message) { SpellBoostGroupIndexList.Add(message); } }