Beispiel #1
0
        public static DeclareTaskDaily Create(int in_conditions_npc, string in_daily_task_x_z, string in_double_currency, string in_fillStarcost, int in_id, int in_npc_id, string in_over_currency, int in_over_npc, string in_rewards_0, string in_rewards_1, string in_rewards_2, string in_rewards_3, string in_rewards_4, string in_rewards_5, string in_star, string in_task_name, int in_task_talk_over, int in_task_talk_start, int in_task_type, string in_typeName)
        {
            DeclareTaskDaily tmp = new DeclareTaskDaily();

            tmp._conditions_npc  = in_conditions_npc;
            tmp._daily_task_x_z  = in_daily_task_x_z;
            tmp._double_currency = in_double_currency;
            tmp._fillStarcost    = in_fillStarcost;
            tmp._id              = in_id;
            tmp._npc_id          = in_npc_id;
            tmp._over_currency   = in_over_currency;
            tmp._over_npc        = in_over_npc;
            tmp._rewards_0       = in_rewards_0;
            tmp._rewards_1       = in_rewards_1;
            tmp._rewards_2       = in_rewards_2;
            tmp._rewards_3       = in_rewards_3;
            tmp._rewards_4       = in_rewards_4;
            tmp._rewards_5       = in_rewards_5;
            tmp._star            = in_star;
            tmp._task_name       = in_task_name;
            tmp._task_talk_over  = in_task_talk_over;
            tmp._task_talk_start = in_task_talk_start;
            tmp._task_type       = in_task_type;
            tmp._typeName        = in_typeName;

            return(tmp);
        }
Beispiel #2
0
        public static void SetData()
        {
            if (_dataCaches == null && LuaEnv.isLoadLuaCfg)
            {
                long startTime = DateTime.Now.Ticks;
                Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataTaskDaily");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataTaskDaily = require 'Lua/Config/DataTaskDaily'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataTaskDaily");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareTaskDaily>(3276);
                    foreach (var item in dic)
                    {
                        DeclareTaskDaily tmp = new DeclareTaskDaily();
                        tmp.ConditionsNpc  = item.Value[0];
                        tmp.DailyTaskXZ    = CfgStringLua.Get(item.Value[1]);
                        tmp.DoubleCurrency = CfgStringLua.Get(item.Value[2]);
                        tmp.FillStarcost   = CfgStringLua.Get(item.Value[3]);
                        tmp.Id             = item.Value[4];
                        tmp.NpcId          = item.Value[5];
                        tmp.OverCurrency   = CfgStringLua.Get(item.Value[6]);
                        tmp.OverNpc        = item.Value[7];
                        tmp.Rewards0       = CfgStringLua.Get(item.Value[8]);
                        tmp.Rewards1       = CfgStringLua.Get(item.Value[9]);
                        tmp.Rewards2       = CfgStringLua.Get(item.Value[10]);
                        tmp.Rewards3       = CfgStringLua.Get(item.Value[11]);
                        tmp.Rewards4       = CfgStringLua.Get(item.Value[12]);
                        tmp.Rewards5       = CfgStringLua.Get(item.Value[13]);
                        tmp.Star           = CfgStringLua.Get(item.Value[14]);
                        tmp.TaskName       = CfgStringLua.Get(item.Value[15]);
                        tmp.TaskTalkOver   = item.Value[16];
                        tmp.TaskTalkStart  = item.Value[17];
                        tmp.TaskType       = item.Value[18];
                        tmp.TypeName       = CfgStringLua.Get(item.Value[19]);

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "TaskDaily");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareTaskDaily>(3276);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "TaskDaily");
                }
            }
        }