Exemple #1
0
        public void OnClickCell()
        {
            MountSkillDataModel data = item.Item as MountSkillDataModel;

            if (data != null)
            {
                EventDispatcher.Instance.DispatchEvent(new OnMountAction_Event(30, data.MountSkillId));
            }
        }
        public void CleanUp()
        {
            needItem  = -1;
            needCount = -1;
            var list     = new List <MountItemDataModel>();
            var skinList = new List <MountItemDataModel>();

            DataModel = new MountDataModel();
            FeedMaterialList.Clear();
            Table.ForeachMount(tb =>
            {
                if (tb.Level != 1)
                {
                    return(true);
                }
                var item           = new MountItemDataModel();
                item.MountId       = tb.Id;
                item.Level         = tb.Level;
                item.Step          = tb.Step;
                item.ItemId        = tb.ItemId;
                item.IsOpen        = tb.IsOpen;
                item.IsPermanent   = tb.IsPermanent;
                item.ValidityData  = tb.ValidityData;
                item.NeedItemId    = tb.NeedItem;
                item.NeedItemCount = tb.GetExp;//策划指定用此数据
                if (tb.Special > 0)
                {
                    item.strLimit    = GameUtils.GetDictionaryText(274032);
                    var skinAddFight = new Dictionary <int, int>();
                    for (int i = 0; i < tb.Attr.Length && i < tb.Value.Length; i++)
                    {
                        if (tb.Attr[i] > 0)
                        {
                            skinAddFight.modifyValue(tb.Attr[i], tb.Value[i]);
                        }
                    }
                    item.SkinAddFightPoint = PlayerDataManager.Instance.GetElfAttrFightPoint(skinAddFight);
                    skinList.Add(item);
                }
                else
                {
                    item.strLimit = string.Format(GameUtils.GetDictionaryText(274000), tb.Step, tb.Level);
                    list.Add(item);
                }
                if (tb.SkillId > 0)
                {
                    m_DicSkill2Mount.Add(tb.SkillId, tb.Id);
                }
                return(true);
            });
            list.Sort((a, b) =>
            {
                return(a.Step > b.Step?1:-1);
            });
            for (int i = 0; i < list.Count; i++)
            {
                DataModel.MountBag.Add(list[i]);
            }

            skinList.Sort((a, b) =>
            {
                return(a.Step > b.Step ? 1 : -1);
            });
            for (int i = 0; i < skinList.Count; i++)
            {
                DataModel.MountSkinBag.Add(skinList[i]);
            }

            Table.ForeachMountFeed(tb =>
            {
                MountFeedItemDataModel item = new MountFeedItemDataModel();
                item.Item        = new ItemIdDataModel();
                item.Item.ItemId = tb.Id;
                item.MaxCount    = tb.MaxCount;
                item.NowCount    = 0;

                FeedMaterialList.Add(tb.Id);
                DataModel.FeedItems.Add(item);
                return(true);
            });

            Table.ForeachMountSkill(tb =>
            {
                MountSkillDataModel skill = new MountSkillDataModel();
                skill.SkillId             = tb.Id;
                if (m_DicSkill2Mount.ContainsKey(tb.Id))
                {
                    skill.MountId = m_DicSkill2Mount[tb.Id];
                }
                DataModel.SkillList.Add(skill);
                return(true);
            });
            DataModel.SkillList[0].IsSelect = true;
            DataModel.SelectSkill.CopyFrom(DataModel.SkillList[0]);
        }