コード例 #1
0
ファイル: DeclareTaskTalk.cs プロジェクト: chenxihan/record
        public static DeclareTaskTalk Create(string in_content, int in_id, int in_model, string in_name, int in_nextid, int in_showName, int in_side, string in_speech)
        {
            DeclareTaskTalk tmp = new DeclareTaskTalk();

            tmp._content  = in_content;
            tmp._id       = in_id;
            tmp._model    = in_model;
            tmp._name     = in_name;
            tmp._nextid   = in_nextid;
            tmp._showName = in_showName;
            tmp._side     = in_side;
            tmp._speech   = in_speech;

            return(tmp);
        }
コード例 #2
0
ファイル: DeclareTaskTalk.cs プロジェクト: chenxihan/record
        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[]> >("DataTaskTalk");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataTaskTalk = require 'Lua/Config/DataTaskTalk'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataTaskTalk");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareTaskTalk>(516);
                    foreach (var item in dic)
                    {
                        DeclareTaskTalk tmp = new DeclareTaskTalk();
                        tmp.Content  = CfgStringLua.Get(item.Value[0]);
                        tmp.Id       = item.Value[1];
                        tmp.Model    = item.Value[2];
                        tmp.Name     = CfgStringLua.Get(item.Value[3]);
                        tmp.Nextid   = item.Value[4];
                        tmp.ShowName = item.Value[5];
                        tmp.Side     = item.Value[6];
                        tmp.Speech   = CfgStringLua.Get(item.Value[7]);

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