Пример #1
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[]> >("DataStatueModel");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataStatueModel = require 'Lua/Config/DataStatueModel'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataStatueModel");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareStatueModel>(14);
                    foreach (var item in dic)
                    {
                        DeclareStatueModel tmp = new DeclareStatueModel();
                        tmp.DirX      = item.Value[0];
                        tmp.DirY      = item.Value[1];
                        tmp.Id        = item.Value[2];
                        tmp.Mapid     = item.Value[3];
                        tmp.Model1    = item.Value[4];
                        tmp.Model2    = item.Value[5];
                        tmp.Model3    = item.Value[6];
                        tmp.Model4    = item.Value[7];
                        tmp.Model5    = item.Value[8];
                        tmp.Model6    = item.Value[9];
                        tmp.Npcid     = item.Value[10];
                        tmp.SizeScale = item.Value[11];
                        tmp.Type      = item.Value[12];
                        tmp.X         = item.Value[13];
                        tmp.Y         = item.Value[14];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "StatueModel");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareStatueModel>(14);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "StatueModel");
                }
            }
        }
Пример #2
0
 public static void Convert(Dictionary <int, DeclareStatueModel> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(100, DeclareStatueModel.Create(0, 0, 100, 101, 6500, 6501, 6502, 6503, 6504, 6505, 10111, 100, 1, 136, 75));
     data.Add(101, DeclareStatueModel.Create(0, -90, 101, 101, 6500, 6501, 6502, 6503, 6504, 6505, 10112, 100, 1, 127, 87));
     data.Add(102, DeclareStatueModel.Create(0, -90, 102, 101, 6500, 6501, 6502, 6503, 6504, 6505, 10113, 100, 1, 127, 82));
     data.Add(103, DeclareStatueModel.Create(0, 90, 103, 101, 6500, 6501, 6502, 6503, 6504, 6505, 10114, 100, 1, 118, 91));
     data.Add(104, DeclareStatueModel.Create(0, 90, 104, 101, 6500, 6501, 6502, 6503, 6504, 6505, 10115, 100, 1, 118, 87));
     data.Add(105, DeclareStatueModel.Create(0, -90, 105, 101, 6500, 6501, 6502, 6503, 6504, 6505, 10116, 100, 1, 127, 91));
     data.Add(900, DeclareStatueModel.Create(0, 0, 900, 900, 6500, 6501, 6502, 6503, 6504, 6505, 33100, 100, 2, 154, 173));
     data.Add(901, DeclareStatueModel.Create(0, 0, 901, 900, 6500, 6501, 6502, 6503, 6504, 6505, 33101, 100, 2, 154, 55));
     data.Add(902, DeclareStatueModel.Create(0, 0, 902, 900, 6500, 6501, 6502, 6503, 6504, 6505, 33102, 100, 2, 147, 55));
     data.Add(903, DeclareStatueModel.Create(0, 0, 903, 900, 6500, 6501, 6502, 6503, 6504, 6505, 33103, 100, 2, 164, 55));
     data.Add(10000, DeclareStatueModel.Create(0, 0, 10000, 650, 6500, 6501, 6502, 6503, 6504, 6505, 33100, 100, 3, 40, 36));
     data.Add(10001, DeclareStatueModel.Create(0, 0, 10001, 650, 6500, 6501, 6502, 6503, 6504, 6505, 33101, 100, 3, 45, 47));
     data.Add(10002, DeclareStatueModel.Create(0, 0, 10002, 650, 6500, 6501, 6502, 6503, 6504, 6505, 33102, 100, 3, 31, 32));
     data.Add(10003, DeclareStatueModel.Create(0, 0, 10003, 650, 6500, 6501, 6502, 6503, 6504, 6505, 33103, 100, 3, 51, 32));
 }
Пример #3
0
        public static DeclareStatueModel Create(int in_dirX, int in_dirY, int in_id, int in_mapid, int in_model_1, int in_model_2, int in_model_3, int in_model_4, int in_model_5, int in_model_6, int in_npcid, int in_size_scale, int in_type, int in_x, int in_y)
        {
            DeclareStatueModel tmp = new DeclareStatueModel();

            tmp._dirX       = in_dirX;
            tmp._dirY       = in_dirY;
            tmp._id         = in_id;
            tmp._mapid      = in_mapid;
            tmp._model_1    = in_model_1;
            tmp._model_2    = in_model_2;
            tmp._model_3    = in_model_3;
            tmp._model_4    = in_model_4;
            tmp._model_5    = in_model_5;
            tmp._model_6    = in_model_6;
            tmp._npcid      = in_npcid;
            tmp._size_scale = in_size_scale;
            tmp._type       = in_type;
            tmp._x          = in_x;
            tmp._y          = in_y;

            return(tmp);
        }