Exemplo n.º 1
0
    public FashionShopConfigItem GetReputationConfig(uint fashion_id)
    {
        FashionShopConfigItem data = null;

        reputationConfigs.TryGetValue(fashion_id, out data);
        return(data);
    }
Exemplo n.º 2
0
    static int getFashionType(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            FashionShopConfigItem obj = (FashionShopConfigItem)LuaScriptMgr.GetNetObjectSelf(L, 1, "FashionShopConfigItem");
            List <uint>           o   = obj.getFashionType();
            LuaScriptMgr.PushObject(L, o);
            return(1);
        }
        else if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(uint)))
        {
            uint        arg0 = (uint)LuaDLL.lua_tonumber(L, 1);
            List <uint> o    = FashionShopConfigItem.getFashionType(arg0);
            LuaScriptMgr.PushObject(L, o);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: FashionShopConfigItem.getFashionType");
        }

        return(0);
    }
    static int FindLast(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        List <FashionShopConfigItem>      obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
        Predicate <FashionShopConfigItem> arg0 = null;
        LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

        if (funcType2 != LuaTypes.LUA_TFUNCTION)
        {
            arg0 = (Predicate <FashionShopConfigItem>)LuaScriptMgr.GetNetObject(L, 2, typeof(Predicate <FashionShopConfigItem>));
        }
        else
        {
            LuaFunction func = LuaScriptMgr.GetLuaFunction(L, 2);
            arg0 = (param0) =>
            {
                int top = func.BeginPCall();
                LuaScriptMgr.PushObject(L, param0);
                func.PCall(top, 1);
                object[] objs = func.PopValues(top);
                func.EndPCall(top);
                return((bool)objs[0]);
            };
        }

        FashionShopConfigItem o = obj.FindLast(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Exemplo n.º 4
0
 public void init(FashionShopConfigItem item)
 {
     _gender    = item.getGender();
     _isDressOn = item.isDressOn();
     _isTry     = false;
     _isExpired = item.isInDate();
     _fashionID = item._fashionID;
 }
    static int Add(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        List <FashionShopConfigItem> obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
        FashionShopConfigItem        arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));

        obj.Add(arg0);
        return(0);
    }
Exemplo n.º 6
0
    static int OnBuyOne(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        UIStoreFashion        obj  = (UIStoreFashion)LuaScriptMgr.GetNetObjectSelf(L, 1, "UIStoreFashion");
        FashionShopConfigItem arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));

        obj.OnBuyOne(arg0);
        return(0);
    }
Exemplo n.º 7
0
    static int isDressOn(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        FashionShopConfigItem obj = (FashionShopConfigItem)LuaScriptMgr.GetNetObjectSelf(L, 1, "FashionShopConfigItem");
        bool o = obj.isDressOn();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Exemplo n.º 8
0
    static int getName(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        FashionShopConfigItem obj = (FashionShopConfigItem)LuaScriptMgr.GetNetObjectSelf(L, 1, "FashionShopConfigItem");
        string o = obj.getName();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Exemplo n.º 9
0
    static int getActualDayDur(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        FashionShopConfigItem obj = (FashionShopConfigItem)LuaScriptMgr.GetNetObjectSelf(L, 1, "FashionShopConfigItem");
        List <uint>           o   = obj.getActualDayDur();

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
    static int Insert(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        List <FashionShopConfigItem> obj = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
        int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
        FashionShopConfigItem arg1 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 3, typeof(FashionShopConfigItem));

        obj.Insert(arg0, arg1);
        return(0);
    }
Exemplo n.º 11
0
    static int getFItem(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        UIStoreFashion        obj  = (UIStoreFashion)LuaScriptMgr.GetNetObjectSelf(L, 1, "UIStoreFashion");
        uint                  arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        FashionShopConfigItem o    = obj.getFItem(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Exemplo n.º 12
0
    static int get_Item(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        Dictionary <uint, FashionShopConfigItem> obj = (Dictionary <uint, FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "Dictionary<uint,FashionShopConfigItem>");
        uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        FashionShopConfigItem o = obj[arg0];

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
    static int Remove(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        List <FashionShopConfigItem> obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
        FashionShopConfigItem        arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));
        bool o = obj.Remove(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Exemplo n.º 14
0
    static int Add(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        Dictionary <uint, FashionShopConfigItem> obj = (Dictionary <uint, FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "Dictionary<uint,FashionShopConfigItem>");
        uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        FashionShopConfigItem arg1 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 3, typeof(FashionShopConfigItem));

        obj.Add(arg0, arg1);
        return(0);
    }
Exemplo n.º 15
0
    static int ContainsValue(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        Dictionary <uint, FashionShopConfigItem> obj = (Dictionary <uint, FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "Dictionary<uint,FashionShopConfigItem>");
        FashionShopConfigItem arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));
        bool o = obj.ContainsValue(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Exemplo n.º 16
0
    static int getActuallyCost(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        FashionShopConfigItem obj = (FashionShopConfigItem)LuaScriptMgr.GetNetObjectSelf(L, 1, "FashionShopConfigItem");
        int  arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
        uint arg1;
        uint o = obj.getActuallyCost(arg0, out arg1);

        LuaScriptMgr.Push(L, o);
        LuaScriptMgr.Push(L, arg1);
        return(2);
    }
Exemplo n.º 17
0
    static int TryGetValue(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        Dictionary <uint, FashionShopConfigItem> obj = (Dictionary <uint, FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "Dictionary<uint,FashionShopConfigItem>");
        uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        FashionShopConfigItem arg1 = null;
        bool o = obj.TryGetValue(arg0, out arg1);

        LuaScriptMgr.Push(L, o);
        LuaScriptMgr.PushObject(L, arg1);
        return(2);
    }
Exemplo n.º 18
0
    //public string getTimeLeftStr()
    //{
    //    List<Goods> goods = MainPlayer.Instance.GetGoods(GoodsCategory.GC_FASHION, _fashionID);
    //    if (goods.Count != 1)
    //    {
    //        Debug.LogError("goods Count should be one!!");
    //    }

    //    Goods good = goods[0];
    //    if (good != null)
    //    {
    //        if (good.getTimeLeft() != 0x7fffffff)
    //        {
    //            // return string.Format("{0}", good.getTimeLeft());

    //            uint time = good.getTimeLeft();

    //            uint day = 0;
    //            uint hr = 0;
    //            uint min = 0;

    //            day = time / 86400;

    //            time -= day * 86400;
    //            if (time > 0)
    //            {
    //                hr = time / 3600;
    //                time -= hr * 3600;
    //                if (time > 0)
    //                {
    //                    min = time / 60;
    //                }
    //            }
    //            if (day >= 1)
    //            {
    //                return string.Format(CommonFunction.GetConstString("UI_FASHION_LEFT_TIME"), day, hr);
    //            }
    //            else if (hr >= 1)
    //            {
    //                return string.Format(CommonFunction.GetConstString("UI_FASHION_LEFT_TIME_HOUR"), hr, min);
    //            }

    //            return string.Format(CommonFunction.GetConstString("UI_FASHION_LEFT_TIME_MIN"), min);
    //        }
    //        else
    //        {
    //            return CommonFunction.GetConstString("UI_FASHION_FOREVER");
    //        }
    //    }
    //    return "0";
    //}


    public void setValue(FashionShopConfigItem item)
    {
        _fashionID    = item._fashionID;
        _timeDur      = item._timeDur;
        _costType     = item._costType;
        _costNum      = item._costNum;
        _isDiscount   = item._isDiscount;
        _discountCost = item._discountCost;
        _isNew        = item._isNew;
        _vip          = item._vip;
        _sortValue    = item._sortValue;

        _renewTimeDur  = item._renewTimeDur;
        _renewCostType = item._renewCostType;
        _renewCostNum  = item._renewCostNum;
    }
Exemplo n.º 19
0
 public int Compare(FashionShopConfigItem x, FashionShopConfigItem y)
 {
     if (x == null)
     {
         if (y == null)
         {
             return(0);
         }
         else
         {
             return(1);
         }
     }
     else
     {
         if (y == null)
         {
             return(-1);
         }
         else
         {
             if (x._sortValue < y._sortValue)
             {
                 return(1);
             }
             else if (x._sortValue > y._sortValue)
             {
                 return(-1);
             }
             else
             {
                 if (x._fashionID > y._fashionID)
                 {
                     return(-1);
                 }
                 else if (x._fashionID < y._fashionID)
                 {
                     return(1);
                 }
                 else
                 {
                     return(0);
                 }
             }
         }
     }
 }
Exemplo n.º 20
0
    static int _CreateFashionShopConfigItem(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            FashionShopConfigItem obj = new FashionShopConfigItem();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: FashionShopConfigItem.New");
        }

        return(0);
    }
Exemplo n.º 21
0
    static int set__renewCostNum(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);
        FashionShopConfigItem obj = (FashionShopConfigItem)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name _renewCostNum");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index _renewCostNum on a nil value");
            }
        }

        obj._renewCostNum = (List <uint>)LuaScriptMgr.GetNetObject(L, 3, typeof(List <uint>));
        return(0);
    }
    static int BinarySearch(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 2)
        {
            List <FashionShopConfigItem> obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
            FashionShopConfigItem        arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));
            int o = obj.BinarySearch(arg0);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else if (count == 3)
        {
            List <FashionShopConfigItem>      obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
            FashionShopConfigItem             arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));
            IComparer <FashionShopConfigItem> arg1 = (IComparer <FashionShopConfigItem>)LuaScriptMgr.GetNetObject(L, 3, typeof(IComparer <FashionShopConfigItem>));
            int o = obj.BinarySearch(arg0, arg1);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else if (count == 5)
        {
            List <FashionShopConfigItem> obj = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
            int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
            int arg1 = (int)LuaScriptMgr.GetNumber(L, 3);
            FashionShopConfigItem             arg2 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 4, typeof(FashionShopConfigItem));
            IComparer <FashionShopConfigItem> arg3 = (IComparer <FashionShopConfigItem>)LuaScriptMgr.GetNetObject(L, 5, typeof(IComparer <FashionShopConfigItem>));
            int o = obj.BinarySearch(arg0, arg1, arg2, arg3);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: List<FashionShopConfigItem>.BinarySearch");
        }

        return(0);
    }
Exemplo n.º 23
0
    static int set__vip(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);
        FashionShopConfigItem obj = (FashionShopConfigItem)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name _vip");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index _vip on a nil value");
            }
        }

        obj._vip = (uint)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
Exemplo n.º 24
0
    static int get__fashionID(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);
        FashionShopConfigItem obj = (FashionShopConfigItem)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name _fashionID");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index _fashionID on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj._fashionID);
        return(1);
    }
    static int LastIndexOf(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 2)
        {
            List <FashionShopConfigItem> obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
            FashionShopConfigItem        arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));
            int o = obj.LastIndexOf(arg0);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else if (count == 3)
        {
            List <FashionShopConfigItem> obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
            FashionShopConfigItem        arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));
            int arg1 = (int)LuaScriptMgr.GetNumber(L, 3);
            int o    = obj.LastIndexOf(arg0, arg1);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else if (count == 4)
        {
            List <FashionShopConfigItem> obj  = (List <FashionShopConfigItem>)LuaScriptMgr.GetNetObjectSelf(L, 1, "List<FashionShopConfigItem>");
            FashionShopConfigItem        arg0 = (FashionShopConfigItem)LuaScriptMgr.GetNetObject(L, 2, typeof(FashionShopConfigItem));
            int arg1 = (int)LuaScriptMgr.GetNumber(L, 3);
            int arg2 = (int)LuaScriptMgr.GetNumber(L, 4);
            int o    = obj.LastIndexOf(arg0, arg1, arg2);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: List<FashionShopConfigItem>.LastIndexOf");
        }

        return(0);
    }
Exemplo n.º 26
0
    //public HidePart MappingPart(uint hide_id)
    //{
    //    HidePart data = null;
    //    mapHideParts.TryGetValue(hide_id, out data);
    //    return data;
    //}

    public void ReadConfig()
    {
        if (isLoadFinish == false || GameSystem.Instance.GoodsConfigData.isReadFinish == false)
        {
            return;
        }
        isLoadFinish = false;
        lock (LockObject) { GameSystem.Instance.readConfigCnt += 1; }

        string text = ResourceLoadManager.Instance.GetConfigText(name);

        if (text == null)
        {
            Debug.LogError("LoadConfig failed: " + name);
            return;
        }

        //读取以及处理XML文本的类
        XmlDocument doc = CommonFunction.LoadXmlConfig(name, text);

        XmlNode node_data = doc.SelectSingleNode("Data");

        foreach (XmlNode node_line in node_data.SelectNodes("Line"))
        {
            if (node_line.SelectSingleNode("switch").InnerText == "#")
            {
                continue;
            }

            FashionShopConfigItem data           = new FashionShopConfigItem();
            FashionShopConfigItem reputationData = new FashionShopConfigItem();
            int storeID = int.Parse(node_line.SelectSingleNode("store_id").InnerText);
            if (storeID == (int)StoreType.ST_FASHION)
            {
                data._fashionID = uint.Parse(node_line.SelectSingleNode("id").InnerText);

                string   theValues = node_line.SelectSingleNode("time_dur").InnerText;
                string[] tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint timeDur;
                    if (uint.TryParse(token, out timeDur))
                    {
                        data._timeDur.Add(timeDur);
                    }
                }


                theValues = node_line.SelectSingleNode("cost_type").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costType;
                    if (uint.TryParse(token, out costType))
                    {
                        data._costType.Add(costType);
                    }
                }

                theValues = node_line.SelectSingleNode("cost_num").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costNum;
                    if (uint.TryParse(token, out costNum))
                    {
                        data._costNum.Add(costNum);
                    }
                }


                data._isDiscount = uint.Parse(node_line.SelectSingleNode("is_discount").InnerText);


                theValues = node_line.SelectSingleNode("discount_cost").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint discountCost;
                    if (uint.TryParse(token, out discountCost))
                    {
                        data._discountCost.Add(discountCost);
                    }
                }


                data._isNew     = uint.Parse(node_line.SelectSingleNode("is_new").InnerText);
                data._vip       = uint.Parse(node_line.SelectSingleNode("vip").InnerText);
                data._sortValue = int.Parse(node_line.SelectSingleNode("sort_value").InnerText);



                theValues = node_line.SelectSingleNode("renew_time_dur").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint timeDur;
                    if (uint.TryParse(token, out timeDur))
                    {
                        data._renewTimeDur.Add(timeDur);
                    }
                }


                theValues = node_line.SelectSingleNode("renew_cost_type").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costType;
                    if (uint.TryParse(token, out costType))
                    {
                        data._renewCostType.Add(costType);
                    }
                }

                theValues = node_line.SelectSingleNode("renew_cost_num").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costNum;
                    if (uint.TryParse(token, out costNum))
                    {
                        data._renewCostNum.Add(costNum);
                    }
                }


                List <uint> types  = data.getFashionType();
                uint        gender = data.getGender();
                if (types.Count == 1)
                {
                    uint type = types[0];
                    if (type == 1)
                    {
                        if (gender == 0)
                        {
                            cHeadSort.Add(data);
                            cHeadSort_w.Add(data);
                        }
                        else if (gender == 1)
                        {
                            cHeadSort.Add(data);
                        }
                        else if (gender == 2)
                        {
                            cHeadSort_w.Add(data);
                        }
                    }
                    else if (type == 2)
                    {
                        if (gender == 0)
                        {
                            cClothesSort.Add(data);
                            cClothesSort_w.Add(data);
                        }
                        else if (gender == 1)
                        {
                            cClothesSort.Add(data);
                        }
                        else if (gender == 2)
                        {
                            cClothesSort_w.Add(data);
                        }
                    }
                    else if (type == 3)
                    {
                        if (gender == 0)
                        {
                            cTrouserseSort.Add(data);
                            cTrouserseSort_w.Add(data);
                        }
                        else if (gender == 1)
                        {
                            cTrouserseSort.Add(data);
                        }
                        else if (gender == 2)
                        {
                            cTrouserseSort_w.Add(data);
                        }
                    }
                    else if (type == 4)
                    {
                        if (gender == 0)
                        {
                            cShoesSort.Add(data);
                            cShoesSort_w.Add(data);
                        }
                        else if (gender == 1)
                        {
                            cShoesSort.Add(data);
                        }
                        else if (gender == 2)
                        {
                            cShoesSort_w.Add(data);
                        }
                    }
                    else if (type == 5)
                    {
                        if (gender == 0)
                        {
                            cBackSort.Add(data);
                            cBackSort_w.Add(data);
                        }
                        else if (gender == 1)
                        {
                            cBackSort.Add(data);
                        }
                        else if (gender == 2)
                        {
                            cBackSort_w.Add(data);
                        }
                    }
                }
                else
                {
                    if (gender == 0)
                    {
                        cSuiteSort.Add(data);
                        cSuiteSort_w.Add(data);
                    }
                    else if (gender == 1)
                    {
                        cSuiteSort.Add(data);
                    }
                    else if (gender == 2)
                    {
                        cSuiteSort_w.Add(data);
                    }
                }



                if (gender == 0)
                {
                    configsSort_m.Add(data);
                    configsSort_w.Add(data);
                }
                else if (gender == 1)
                {
                    configsSort_m.Add(data);
                }
                else if (gender == 2)
                {
                    configsSort_w.Add(data);
                }

                configs.Add(data._fashionID, data);
                configsSort.Add(data);
            }
            else if (storeID == (int)StoreType.ST_REPUTATION)
            {
                reputationData._fashionID = uint.Parse(node_line.SelectSingleNode("id").InnerText);

                string   theValues = node_line.SelectSingleNode("time_dur").InnerText;
                string[] tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint timeDur;
                    if (uint.TryParse(token, out timeDur))
                    {
                        reputationData._timeDur.Add(timeDur);
                    }
                }


                theValues = node_line.SelectSingleNode("cost_type").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costType;
                    if (uint.TryParse(token, out costType))
                    {
                        reputationData._costType.Add(costType);
                    }
                }

                theValues = node_line.SelectSingleNode("cost_num").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costNum;
                    if (uint.TryParse(token, out costNum))
                    {
                        reputationData._costNum.Add(costNum);
                    }
                }


                reputationData._isDiscount = uint.Parse(node_line.SelectSingleNode("is_discount").InnerText);


                theValues = node_line.SelectSingleNode("discount_cost").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint discountCost;
                    if (uint.TryParse(token, out discountCost))
                    {
                        reputationData._discountCost.Add(discountCost);
                    }
                }


                reputationData._isNew     = uint.Parse(node_line.SelectSingleNode("is_new").InnerText);
                reputationData._vip       = uint.Parse(node_line.SelectSingleNode("vip").InnerText);
                reputationData._sortValue = int.Parse(node_line.SelectSingleNode("sort_value").InnerText);



                theValues = node_line.SelectSingleNode("renew_time_dur").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint timeDur;
                    if (uint.TryParse(token, out timeDur))
                    {
                        reputationData._renewTimeDur.Add(timeDur);
                    }
                }


                theValues = node_line.SelectSingleNode("renew_cost_type").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costType;
                    if (uint.TryParse(token, out costType))
                    {
                        reputationData._renewCostType.Add(costType);
                    }
                }

                theValues = node_line.SelectSingleNode("renew_cost_num").InnerText;
                tokens    = theValues.Split('&');
                foreach (string token in tokens)
                {
                    uint costNum;
                    if (uint.TryParse(token, out costNum))
                    {
                        reputationData._renewCostNum.Add(costNum);
                    }
                }


                List <uint> types  = reputationData.getFashionType();
                uint        gender = reputationData.getGender();
                if (types.Count == 1)
                {
                    uint type = types[0];
                    if (type == 1)
                    {
                        if (gender == 0)
                        {
                            reputationHeadSort.Add(reputationData);
                            reputationHeadSort_w.Add(reputationData);
                        }
                        else if (gender == 1)
                        {
                            reputationHeadSort.Add(reputationData);
                        }
                        else if (gender == 2)
                        {
                            reputationHeadSort_w.Add(reputationData);
                        }
                    }
                    else if (type == 2)
                    {
                        if (gender == 0)
                        {
                            reputationClothesSort.Add(reputationData);
                            reputationClothesSort_w.Add(reputationData);
                        }
                        else if (gender == 1)
                        {
                            reputationClothesSort.Add(reputationData);
                        }
                        else if (gender == 2)
                        {
                            reputationClothesSort_w.Add(reputationData);
                        }
                    }
                    else if (type == 3)
                    {
                        if (gender == 0)
                        {
                            reputationTrouserseSort.Add(reputationData);
                            reputationTrouserseSort_w.Add(reputationData);
                        }
                        else if (gender == 1)
                        {
                            reputationTrouserseSort.Add(reputationData);
                        }
                        else if (gender == 2)
                        {
                            reputationTrouserseSort_w.Add(reputationData);
                        }
                    }
                    else if (type == 4)
                    {
                        if (gender == 0)
                        {
                            reputationShoesSort.Add(reputationData);
                            reputationShoesSort_w.Add(reputationData);
                        }
                        else if (gender == 1)
                        {
                            reputationShoesSort.Add(reputationData);
                        }
                        else if (gender == 2)
                        {
                            reputationShoesSort_w.Add(reputationData);
                        }
                    }
                    else if (type == 5)
                    {
                        if (gender == 0)
                        {
                            reputationBackSort.Add(reputationData);
                            reputationBackSort_w.Add(reputationData);
                        }
                        else if (gender == 1)
                        {
                            reputationBackSort.Add(reputationData);
                        }
                        else if (gender == 2)
                        {
                            reputationBackSort_w.Add(reputationData);
                        }
                    }
                }
                else
                {
                    if (gender == 0)
                    {
                        reputationSuiteSort.Add(reputationData);
                        reputationSuiteSort_w.Add(reputationData);
                    }
                    else if (gender == 1)
                    {
                        reputationSuiteSort.Add(reputationData);
                    }
                    else if (gender == 2)
                    {
                        reputationSuiteSort_w.Add(reputationData);
                    }
                }



                if (gender == 0)
                {
                    reputationConfigsSort_m.Add(reputationData);
                    reputationConfigsSort_w.Add(reputationData);
                }
                else if (gender == 1)
                {
                    reputationConfigsSort_m.Add(reputationData);
                }
                else if (gender == 2)
                {
                    reputationConfigsSort_w.Add(reputationData);
                }

                reputationConfigs.Add(reputationData._fashionID, reputationData);
                reputationConfigsSort.Add(reputationData);
            }

            //时装
            configsSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));

            configsSort_m.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            configsSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));

            cHeadSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cClothesSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cTrouserseSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cShoesSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cBackSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cSuiteSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));

            cHeadSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cClothesSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cTrouserseSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cShoesSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cBackSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            cSuiteSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));

            //声望
            reputationConfigsSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));

            reputationConfigsSort_m.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationConfigsSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));

            reputationHeadSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationClothesSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationTrouserseSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationShoesSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationBackSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationSuiteSort.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));

            reputationHeadSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationClothesSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationTrouserseSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationShoesSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationBackSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
            reputationSuiteSort_w.Sort(new Comparison <FashionShopConfigItem>(new FashionComparison().Compare));
        }
    }
Exemplo n.º 27
0
    void BuyYes(GameObject go)
    {
        BuyStoreGoods    msg     = new BuyStoreGoods();
        FashionOperation msgOper = null;

        msg.store_id = StoreType.ST_FASHION;

        uint goldCost    = 0;
        uint diamondCost = 0;

        foreach (KeyValuePair <uint, UIStoreFashion.FashionSelectedItem> item in _uiStoreFashion._fashionSelected._dressOnItems)
        {
            FashionShopConfigItem configItem = item.Value._config;
            Fashion_OBB_item      obbItem    = GetOBBItem(configItem._fashionID);

            if (obbItem == null || !obbItem._isSelect)
            {
                continue;
            }
            if (item.Value._selectIndex < 0)
            {
                continue;
            }

            uint costType;
            uint costNum = configItem.getActuallyCost(item.Value._selectIndex, out costType);

            if (costType == 1)
            {
                diamondCost += costNum;
            }
            else if (costType == 2)
            {
                goldCost += costNum;
            }


            if (configItem.isInDate())
            {
                if (null == msgOper)
                {
                    msgOper = new FashionOperation();
                }

                FashionOperationInfo info = new FashionOperationInfo();
                info.type    = (uint)FashionOperationType.FOT_RENEW;
                info.uuid    = configItem.getGood().GetUUID();
                info.subtype = (uint)item.Value._selectIndex + 1;
                msgOper.info.Add(info);
                if (GlobalConst.IS_FASHION_OPEN == 1)
                {
                    msgOper.role_id = MainPlayer.Instance.CaptainID;
                }
            }
            else
            {
                if (item.Value._selectIndex >= 0)
                {
                    uint type;
                    uint cost = item.Value._config.getActuallyCost(item.Value._selectIndex, out type);

                    int pos = GameSystem.Instance.FashionShopConfig.configsSort.IndexOf(item.Value._config);

                    BuyStoreGoodsInfo info = new BuyStoreGoodsInfo();
                    info.pos  = (uint)pos + 1;
                    info.type = (uint)item.Value._selectIndex + 1;
                    msg.info.Add(info);
                }
            }
        }


        if ((diamondCost > MainPlayer.Instance.DiamondBuy + MainPlayer.Instance.DiamondFree) || goldCost > MainPlayer.Instance.Gold)
        {
            CommonFunction.ShowTip(CommonFunction.GetConstString("UI_FASHION_MONEY_NOT_ENGOUGH"));
            return;
        }

        /*
         * PlatNetwork.Instance.BuyStoreGoodsRequest(msg);
         * if (msgOper != null)
         * {
         * PlatNetwork.Instance.UpdateFashionRequest(msgOper);
         * }
         */
    }