Exemple #1
0
    static int _CreateNewComerTotalDataKeyValuePair(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 2)
        {
            uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 1);
            NewComerTotalData arg1 = (NewComerTotalData)LuaScriptMgr.GetNetObject(L, 2, typeof(NewComerTotalData));
            KeyValuePair <uint, NewComerTotalData> obj = new KeyValuePair <uint, NewComerTotalData>(arg0, arg1);
            LuaScriptMgr.PushValue(L, obj);
            return(1);
        }
        else if (count == 0)
        {
            KeyValuePair <uint, NewComerTotalData> obj = new KeyValuePair <uint, NewComerTotalData>();
            LuaScriptMgr.PushValue(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: KeyValuePair<uint,NewComerTotalData>.New");
        }

        return(0);
    }
Exemple #2
0
    public void ReadConfig()
    {
        if (isLoadFinish == false)
        {
            return;
        }
        isLoadFinish = false;
        lock (LockObject) { GameSystem.Instance.readConfigCnt += 1; }

        Debug.Log("Config reading " + name);
        string text = ResourceLoadManager.Instance.GetConfigText(name);

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

        XmlDocument doc  = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_NEWCOMERSIGN, text);
        XmlNode     root = doc.SelectSingleNode("Data");

        foreach (XmlNode line in root.SelectNodes("Line"))
        {
            if (CommonFunction.IsCommented(line))
            {
                continue;
            }
            NewComerSignData  signData      = new NewComerSignData();
            NewComerTotalData totalData     = new NewComerTotalData();
            XmlElement        signDay       = line.SelectSingleNode("day") as XmlElement;
            XmlElement        signType      = line.SelectSingleNode("type") as XmlElement;
            XmlElement        signAward     = line.SelectSingleNode("awards") as XmlElement;
            XmlElement        appendConsume = line.SelectSingleNode("append_consume") as XmlElement;
            XmlElement        desc          = line.SelectSingleNode("desc") as XmlElement;
            int type = int.Parse(signType.InnerText);
            if (type == 1)
            {
                string[] sign = signAward.InnerText.Split(':');
                signData.awardType = uint.Parse(sign[0]);
                signData.awardNum  = uint.Parse(sign[1]);
                string[] consume = appendConsume.InnerText.Split(':');
                signData.consumeType = uint.Parse(consume[0]);
                signData.consumeNum  = uint.Parse(consume[1]);
                signData.descript    = desc.InnerText;
                configData.Add(uint.Parse(signDay.InnerText), signData);
            }
            else if (type == 2)
            {
                string[] totalAwards = signAward.InnerText.Split('&');
                foreach (string award in totalAwards)
                {
                    totalData.totalAwards.Add(award);
                }
                totalData.descript = desc.InnerText;
                totalConfigData.Add(uint.Parse(signDay.InnerText), totalData);
            }
        }
    }
    static int ContainsValue(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        Dictionary <uint, NewComerTotalData> obj = (Dictionary <uint, NewComerTotalData>)LuaScriptMgr.GetNetObjectSelf(L, 1, "Dictionary<uint,NewComerTotalData>");
        NewComerTotalData arg0 = (NewComerTotalData)LuaScriptMgr.GetNetObject(L, 2, typeof(NewComerTotalData));
        bool o = obj.ContainsValue(arg0);

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

        obj.Add(arg0, arg1);
        return(0);
    }
    static int get_Item(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        Dictionary <uint, NewComerTotalData> obj = (Dictionary <uint, NewComerTotalData>)LuaScriptMgr.GetNetObjectSelf(L, 1, "Dictionary<uint,NewComerTotalData>");
        uint arg0           = (uint)LuaScriptMgr.GetNumber(L, 2);
        NewComerTotalData o = obj[arg0];

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
    static int TryGetValue(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        Dictionary <uint, NewComerTotalData> obj = (Dictionary <uint, NewComerTotalData>)LuaScriptMgr.GetNetObjectSelf(L, 1, "Dictionary<uint,NewComerTotalData>");
        uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        NewComerTotalData arg1 = null;
        bool o = obj.TryGetValue(arg0, out arg1);

        LuaScriptMgr.Push(L, o);
        LuaScriptMgr.PushObject(L, arg1);
        return(2);
    }
Exemple #7
0
    static int _CreateNewComerTotalData(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

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

        return(0);
    }
Exemple #8
0
    static int get_descript(IntPtr L)
    {
        object            o   = LuaScriptMgr.GetLuaObject(L, 1);
        NewComerTotalData obj = (NewComerTotalData)o;

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

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

        LuaScriptMgr.Push(L, obj.descript);
        return(1);
    }
Exemple #9
0
    static int set_totalAwards(IntPtr L)
    {
        object            o   = LuaScriptMgr.GetLuaObject(L, 1);
        NewComerTotalData obj = (NewComerTotalData)o;

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

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

        obj.totalAwards = (List <string>)LuaScriptMgr.GetNetObject(L, 3, typeof(List <string>));
        return(0);
    }