Exemplo n.º 1
0
        private void Update_afford()
        {
            Dictionary <ColumnType, Dictionary <string, SItemData> > sItems = this.data.SItems;
            int money = this.data.Money;

            if (sItems != null)
            {
                Dictionary <ColumnType, Dictionary <string, SItemData> > .Enumerator enumerator = sItems.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    KeyValuePair <ColumnType, Dictionary <string, SItemData> > current = enumerator.Current;
                    Dictionary <string, SItemData> value = current.Value;
                    if (value != null)
                    {
                        Dictionary <string, SItemData> .Enumerator enumerator2 = value.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            KeyValuePair <string, SItemData> current2 = enumerator2.Current;
                            SItemData value2 = current2.Value;
                            value2.Update_afford(money);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private bool callback(object obj, int depth)
        {
            bool      result    = true;
            SItemData sItemData = obj as SItemData;

            if (sItemData != null)
            {
                if (sItemData.Possessed && !sItemData.ID.Equals(this._target.ID))
                {
                    if (this.dicUse.ContainsKey(sItemData.ID))
                    {
                        Dictionary <string, int> dictionary;
                        Dictionary <string, int> expr_51 = dictionary = this.dicUse;
                        string iD;
                        string expr_59 = iD = sItemData.ID;
                        int    num     = dictionary[iD];
                        expr_51[expr_59] = num + 1;
                    }
                    else
                    {
                        this.dicUse.Add(sItemData.ID, 1);
                    }
                    if (this.dicUse[sItemData.ID] <= sItemData.PossessedNum)
                    {
                        this.price -= sItemData.Config.sell;
                        result      = false;
                    }
                }
            }
            else
            {
                result = false;
            }
            return(result);
        }
Exemplo n.º 3
0
        private void Update_possess()
        {
            Dictionary <ColumnType, Dictionary <string, SItemData> > sItems = this.data.SItems;
            List <string> pItemsStr = this.data.PItemsStr;

            if (sItems != null)
            {
                Dictionary <ColumnType, Dictionary <string, SItemData> > .Enumerator enumerator = sItems.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    KeyValuePair <ColumnType, Dictionary <string, SItemData> > current = enumerator.Current;
                    Dictionary <string, SItemData> value = current.Value;
                    if (value != null)
                    {
                        Dictionary <string, SItemData> .Enumerator enumerator2 = value.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            KeyValuePair <string, SItemData> current2 = enumerator2.Current;
                            SItemData value2 = current2.Value;
                            value2.Update_possess(pItemsStr);
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void OnMsg_BattleShop_setInShopArea(MobaMessage msg)
        {
            ShopInfo shopInfo;
            bool     flag;

            if (this.SetShopArea((Dictionary <EBattleShopType, bool>)msg.Param, out shopInfo, out flag))
            {
                if (this.OpenShop != null && !this.OpenShop.InArea && shopInfo != null && shopInfo != this.OpenShop)
                {
                    this.PreOpenShop = this.OpenShop;
                    this.OpenShop    = shopInfo;
                    if (this.PreOpenShop != this.OpenShop)
                    {
                        this.Update_menu(this.CurMenu);
                        SItemData curSItem = this.CurSItem;
                        this.Update_curSItem(null);
                        this.Update_sItems();
                        if (this.SItems != null && curSItem != null && this.SItems.ContainsKey(curSItem.Level) && this.SItems[curSItem.Level].ContainsKey(curSItem.ID))
                        {
                            this.Update_curSItem(this.SItems[curSItem.Level][curSItem.ID]);
                        }
                    }
                }
                MobaMessageManagerTools.SendClientMsg(ClientC2V.BattleShop_inShopAreaChanged, flag, false);
                this.Update_brawlCanbuy();
            }
        }
Exemplo n.º 5
0
 public void Reset(SItemData target)
 {
     this._target = target;
     this.price   = this._target.Config.sell;
     if (this.dicUse == null)
     {
         this.dicUse = new Dictionary <string, int>();
     }
     else
     {
         this.dicUse.Clear();
     }
 }
Exemplo n.º 6
0
        public void Update_curSItem()
        {
            SItemData curSItem = this.data.CurSItem;
            SItemData preSItem = this.data.PreSItem;

            if (preSItem != null)
            {
                preSItem.ChooseState = false;
            }
            if (curSItem != null)
            {
                curSItem.ChooseState = true;
            }
        }
Exemplo n.º 7
0
        public void Update_curSRItem()
        {
            SItemData curSRItem = this.data.CurSRItem;
            SItemData preSRItem = this.data.PreSRItem;

            if (preSRItem != null)
            {
                preSRItem.Update_route(this.data.Sections, true, true, false);
            }
            this.ResetSection();
            if (curSRItem != null)
            {
                curSRItem.Update_route(this.data.Sections, true, true, true);
            }
        }
Exemplo n.º 8
0
 public GetRealPrice(SItemData target)
 {
     this._target = target;
     this.price   = this._target.Config.sell;
     this.dicUse  = new Dictionary <string, int>();
 }