Ejemplo n.º 1
0
 /// <summary>
 /// 回池
 /// </summary>
 protected override void toRelease(DataPool pool)
 {
     this.booleanDic = null;
     this.intDic     = null;
     this.longDic    = null;
     this.stringDic  = null;
 }
Ejemplo n.º 2
0
        public void FromSMap(SMap map)
        {
            End       = map.End;
            EndLayer  = map.EndLayer;
            EndSide   = map.EndSide;
            LevelGUID = map.LevelGUID;
            //  MapHeight = map.MapHeight;
            //   MapWidth = map.MapWidth;
            Start      = map.Start;
            StartLayer = map.StartLayer;
            StartSide  = map.StartSide;

            var i = 0;

            for (int r = 0; r < map.MapHeight; r++)
            {
                for (var c = 0; c < map.MapWidth; c++)
                {
                    if (map.Layer1[i] != 0 || map.Layer1[i] != 0)
                    {
                        var t = new TileData(new Point(c, r), map.Layer1[i], map.Layer2[i], Tiles);
                        Tiles.Add(t);
                        if ((int)Start.X == c && (int)Start.Y == r)
                        {
                            CurrentTile = t;
                        }
                    }
                    i++;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 初始化初值
 /// </summary>
 public override void initDefault()
 {
     this.booleanDic = new IntBooleanMap();
     this.intDic     = new IntIntMap();
     this.longDic    = new IntLongMap();
     this.stringDic  = new SMap <string, string>();
 }
Ejemplo n.º 4
0
    protected override void onAddItemNotice(SList <ItemData> list, int way)
    {
        SMap <string, object> param = new SMap <string, object>();

        param.put("list", list);
        param.put("way", way);

        me.dispatch(GameEventType.AddItemNotice, param);
    }
Ejemplo n.º 5
0
 /** 初始化数据信息 */
 private void initData()
 {
     _bundleInfoDataList      = new SMap <string, BundleInfoData>();
     _bundleInfoExDataList    = new SMap <string, BundleInfoExData>();
     _resourceInfoDataList    = new SMap <int, ResourceInfoData>();
     _resourceInfoExDataList  = new SMap <int, ResourceInfoExData>();
     _resourceInfoExDataCache = new SMap <string, ResourceInfoExData>();
     _resourceIndex           = 1;
 }
Ejemplo n.º 6
0
    /** 设置局部变量 */
    public void setLocalVar(string str, object value)
    {
        SMap <string, object> dic;

        if ((dic = root._localVarDic) == null)
        {
            root._localVarDic = dic = new SMap <string, object>();
        }

        dic.put(str, value);
    }
Ejemplo n.º 7
0
        public override bool AddMap(string mapType)
        {
            if (!base.AddMap(mapType))
                return false;

            SMap map = new SMap(Create.Map(mapType));

            AddMap(map);

            return true;
        }
Ejemplo n.º 8
0
        /** 读取bundle配置 */
        private void readResourceInfoConfig()
        {
            string[][] re = ToolFileUtils.readFileForExcelFirstSheet(ShineToolGlobal.resourceInfoPath);

            _defaultSaveType       = int.Parse(re[0][1]);
            _signedResourceSaveDic = new SMap <string, int>();

            for (int i = 2; i < re.Length; i++)
            {
                _signedResourceSaveDic.put(re[i][0], int.Parse(re[i][1]));
            }
        }
Ejemplo n.º 9
0
    /// <summary>
    /// 复制(潜拷贝)
    /// </summary>
    protected override void toShadowCopy(BaseData data)
    {
        if (!(data is KeepSaveData))
        {
            return;
        }

        KeepSaveData mData = (KeepSaveData)data;

        this.booleanDic = mData.booleanDic;
        this.intDic     = mData.intDic;
        this.longDic    = mData.longDic;
        this.stringDic  = mData.stringDic;
    }
Ejemplo n.º 10
0
        private static void initElementNames()
        {
            _elementDic       = new SMap <string, string>();
            _elementPrefabDic = new SMap <string, GameObject>();

            string[] files = FileUtils.getDeepFileList(ShineToolGlobal.uiElementsPath, "prefab");
            for (int i = 0; i < files.Length; i++)
            {
                string assetsPath = ToolFileUtils.getAssetsPath(files[i]);

                GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(assetsPath);

                _elementDic.put(assetsPath, prefab.name);
                _elementPrefabDic.put(assetsPath, prefab);
            }
        }
Ejemplo n.º 11
0
    protected override void afterReadConfig()
    {
        base.afterReadConfig();

        bindPointMap = new SMap <int, Vector3>();
        for (int i = bindPoints.Length - 1; i >= 0; --i)
        {
            float[] tmp = bindPoints[i];
            if (tmp.Length > 3)
            {
                bindPointMap.put((int)tmp[0], new Vector3(tmp[1], tmp[2], tmp[3]));
            }
            else if (tmp.Length > 2)
            {
                bindPointMap.put((int)tmp[0], new Vector3(tmp[1], tmp[2]));
            }
        }
    }
Ejemplo n.º 12
0
        protected PackWindow init()
        {
            SMap <BuildTarget, string> targetMap = PackControl.instance().getTargetMap();

            _targetArr      = new BuildTarget[targetMap.size()];
            _targetNameArr  = new string[targetMap.size()];
            _targetIndexMap = new SMap <BuildTarget, int>();
            int i = 0;

            targetMap.forEach((k, v) =>
            {
                _targetArr[i]      = k;
                _targetNameArr[i]  = v;
                _targetIndexMap[k] = i++;
            });

            selectNormalTarget();

            _version = EditorPrefs.GetString("AssetBundleWindow_version");

            return(this);
        }
Ejemplo n.º 13
0
 public SMap GetSMap()
 => SMap.Parse(WZ.Resolve("Base"));
Ejemplo n.º 14
0
 /// <summary>
 /// Map清空
 /// </summary>
 public void func_MapClear(TriggerExecutor e, TriggerArg a, SMap <object, object> map)
 {
     map.clear();
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 添加字典(热更用)
 /// </summary>
 public static void addDic(SMap <string, PlatformConfig> dic)
 {
     _dic.putAll(dic);
 }
Ejemplo n.º 16
0
 public CColony(Integer PosX, Integer PosY, SMap Map) : base(PosX, PosY, Map) { }
Ejemplo n.º 17
0
        /// <summary>
        /// 生成UI预制
        /// </summary>
        /// <param name="force">是否强制全部生成(如果否,则增量生成,只生成改变量)</param>
        public static void make(bool force = false)
        {
            EditorUtility.DisplayProgressBar("请耐心等待", "正在抽离UI预制体...", 0.0f);

            /** 需要处理的预制体列表 */
            SMap <string, long> generateList = new SMap <string, long>();
            /** 全部预处理列表(包含当前所有的预制体修改记录,用于生成记录文件) */
            SMap <string, long> allGenerateList = new SMap <string, long>();

            if (!Directory.Exists(ShineToolGlobal.uiModelsPath))
            {
                Directory.CreateDirectory(ShineToolGlobal.uiModelsPath);
            }

            if (!Directory.Exists(ShineToolGlobal.uiGenerateModelsPath))
            {
                Directory.CreateDirectory(ShineToolGlobal.uiGenerateModelsPath);
                force = true;
            }

            //生成新预处理列表
            string[] files   = FileUtils.getDeepFileList(ShineToolGlobal.uiModelsPath, "prefab");
            int      pathLen = ShineToolGlobal.gamePath.Length + 1;

            for (int i = 0; i < files.Length; i++)
            {
                string file = files[i];
                long   time = File.GetLastWriteTime(file).Ticks;
                file = file.Substring(pathLen);
                generateList.put(file, time);
                allGenerateList.put(file, time);
            }

            //读取旧预处理列表
            BytesReadStream stream = FileUtils.readFileForBytesReadStream(ShineToolGlobal.uiRecordPath);

            //读取旧预处理列表
            if (force || stream == null || !stream.checkVersion(ShineToolGlobal.uiRecordVersion))
            {
                FileUtils.clearDir(ShineToolGlobal.uiGenerateModelsPath);
            }
            else
            {
                /** 旧预处理列表 */
                SMap <string, long> oldGenerateList = new SMap <string, long>();

                int len = stream.readInt();
                for (int i = 0; i < len; ++i)
                {
                    oldGenerateList[stream.readUTF()] = stream.readLong();
                }

                //比较新旧预制列表,并删除无效预制
                oldGenerateList.forEach((k, v) =>
                {
                    long newTime;
                    string genPath = ShineToolGlobal.uiGenerateModelsPath + "/";
                    if (generateList.tryGetValue(k, out newTime))                //如果新列表里有
                    {
                        if (newTime == oldGenerateList[k])                       //如果未修改,则不用抽离
                        {
                            generateList.remove(k);
                        }
                        else                          //如果已修改
                        {
                            File.Delete(genPath + Path.GetFileName(k));
                        }
                    }
                    else                      //新列表里没有,说明已删除
                    {
                        File.Delete(genPath + Path.GetFileName(k));
                    }
                });
            }

            //生成UI预制
            int progressNum = generateList.length() + 1;
            int curNum      = 0;

            generateList.forEach((k, v) =>
            {
                generateUIPrefab(k);
                ++curNum;
                EditorUtility.DisplayProgressBar("请耐心等待", "正在抽离UI预制体...", (float)curNum / progressNum);
            });

            //写入记录
            BytesWriteStream buffer = new BytesWriteStream();

            buffer.writeVersion(ShineToolGlobal.uiRecordVersion);

            buffer.writeInt(allGenerateList.Count);

            allGenerateList.forEach((k, v) =>
            {
                buffer.writeUTF(k);
                buffer.writeLong(allGenerateList[k]);
            });

            FileUtils.writeFileForBytes(ShineToolGlobal.uiRecordPath, buffer);

            EditorUtility.ClearProgressBar();
        }
Ejemplo n.º 18
0
 public EditArena(Golf game, BaseArena previousArena, SMap map) : base(game, previousArena)
 {
     FromSMap(map);
     Initialise();
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 添加字典(热更用)
 /// </summary>
 public static void addDic(SMap <string, InternationalResourceConfig> dic)
 {
     _dic.putAll(dic);
 }
Ejemplo n.º 20
0
    /// <summary>
    /// 复制(深拷贝)
    /// </summary>
    protected override void toCopy(BaseData data)
    {
        if (!(data is KeepSaveData))
        {
            return;
        }

        KeepSaveData mData = (KeepSaveData)data;

        if (mData.booleanDic != null)
        {
            if (this.booleanDic != null)
            {
                this.booleanDic.clear();
                this.booleanDic.ensureCapacity(mData.booleanDic.size());
            }
            else
            {
                this.booleanDic = new IntBooleanMap(mData.booleanDic.size());
            }

            IntBooleanMap booleanDicT = this.booleanDic;
            if (!mData.booleanDic.isEmpty())
            {
                int    booleanDicKFreeValue = mData.booleanDic.getFreeValue();
                int[]  booleanDicKKeys      = mData.booleanDic.getKeys();
                bool[] booleanDicVValues    = mData.booleanDic.getValues();
                for (int booleanDicKI = booleanDicKKeys.Length - 1; booleanDicKI >= 0; --booleanDicKI)
                {
                    int booleanDicK = booleanDicKKeys[booleanDicKI];
                    if (booleanDicK != booleanDicKFreeValue)
                    {
                        bool booleanDicV = booleanDicVValues[booleanDicKI];
                        int  booleanDicW;
                        bool booleanDicU;
                        booleanDicW = booleanDicK;

                        booleanDicU = booleanDicV;

                        booleanDicT.put(booleanDicW, booleanDicU);
                    }
                }
            }
        }
        else
        {
            this.booleanDic = null;
            nullObjError("booleanDic");
        }

        if (mData.intDic != null)
        {
            if (this.intDic != null)
            {
                this.intDic.clear();
                this.intDic.ensureCapacity(mData.intDic.size());
            }
            else
            {
                this.intDic = new IntIntMap(mData.intDic.size());
            }

            IntIntMap intDicT = this.intDic;
            if (!mData.intDic.isEmpty())
            {
                int   intDicKFreeValue = mData.intDic.getFreeValue();
                int[] intDicKKeys      = mData.intDic.getKeys();
                int[] intDicVValues    = mData.intDic.getValues();
                for (int intDicKI = intDicKKeys.Length - 1; intDicKI >= 0; --intDicKI)
                {
                    int intDicK = intDicKKeys[intDicKI];
                    if (intDicK != intDicKFreeValue)
                    {
                        int intDicV = intDicVValues[intDicKI];
                        int intDicW;
                        int intDicU;
                        intDicW = intDicK;

                        intDicU = intDicV;

                        intDicT.put(intDicW, intDicU);
                    }
                }
            }
        }
        else
        {
            this.intDic = null;
            nullObjError("intDic");
        }

        if (mData.longDic != null)
        {
            if (this.longDic != null)
            {
                this.longDic.clear();
                this.longDic.ensureCapacity(mData.longDic.size());
            }
            else
            {
                this.longDic = new IntLongMap(mData.longDic.size());
            }

            IntLongMap longDicT = this.longDic;
            if (!mData.longDic.isEmpty())
            {
                int    longDicKFreeValue = mData.longDic.getFreeValue();
                int[]  longDicKKeys      = mData.longDic.getKeys();
                long[] longDicVValues    = mData.longDic.getValues();
                for (int longDicKI = longDicKKeys.Length - 1; longDicKI >= 0; --longDicKI)
                {
                    int longDicK = longDicKKeys[longDicKI];
                    if (longDicK != longDicKFreeValue)
                    {
                        long longDicV = longDicVValues[longDicKI];
                        int  longDicW;
                        long longDicU;
                        longDicW = longDicK;

                        longDicU = longDicV;

                        longDicT.put(longDicW, longDicU);
                    }
                }
            }
        }
        else
        {
            this.longDic = null;
            nullObjError("longDic");
        }

        if (mData.stringDic != null)
        {
            if (this.stringDic != null)
            {
                this.stringDic.clear();
                this.stringDic.ensureCapacity(mData.stringDic.size());
            }
            else
            {
                this.stringDic = new SMap <string, string>(mData.stringDic.size());
            }

            SMap <string, string> stringDicT = this.stringDic;
            if (!mData.stringDic.isEmpty())
            {
                string[] stringDicKKeys   = mData.stringDic.getKeys();
                string[] stringDicVValues = mData.stringDic.getValues();
                for (int stringDicKI = stringDicKKeys.Length - 1; stringDicKI >= 0; --stringDicKI)
                {
                    string stringDicK = stringDicKKeys[stringDicKI];
                    if (stringDicK != null)
                    {
                        string stringDicV = stringDicVValues[stringDicKI];
                        string stringDicW;
                        string stringDicU;
                        stringDicW = stringDicK;

                        stringDicU = stringDicV;

                        stringDicT.put(stringDicW, stringDicU);
                    }
                }
            }
        }
        else
        {
            this.stringDic = null;
            nullObjError("stringDic");
        }
    }
Ejemplo n.º 21
0
 /// <summary>
 /// Map删除
 /// </summary>
 public bool func_MapRemove(TriggerExecutor e, TriggerArg a, SMap <object, object> map, object key)
 {
     return(map.remove(key) != null);
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 设置字典
 /// </summary>
 public static void setDic(SMap <string, InternationalResourceConfig> dic)
 {
     _dic = dic;
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 设置字典
 /// </summary>
 public static void setDic(SMap <string, LanguageConfig> dic)
 {
     _dic = dic;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// map是否为空
 /// </summary>
 public bool func_MapIsEmpty(TriggerExecutor e, TriggerArg a, SMap <object, object> map)
 {
     return(map.isEmpty());
 }
Ejemplo n.º 25
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        KeepSaveData mData = (KeepSaveData)data;

        if (mData.booleanDic != null)
        {
            if (this.booleanDic == null)
            {
                return(false);
            }
            if (this.booleanDic.size() != mData.booleanDic.size())
            {
                return(false);
            }
            IntBooleanMap booleanDicR = mData.booleanDic;
            if (!this.booleanDic.isEmpty())
            {
                int    booleanDicKFreeValue = this.booleanDic.getFreeValue();
                int[]  booleanDicKKeys      = this.booleanDic.getKeys();
                bool[] booleanDicVValues    = this.booleanDic.getValues();
                for (int booleanDicKI = booleanDicKKeys.Length - 1; booleanDicKI >= 0; --booleanDicKI)
                {
                    int booleanDicK = booleanDicKKeys[booleanDicKI];
                    if (booleanDicK != booleanDicKFreeValue)
                    {
                        bool booleanDicV = booleanDicVValues[booleanDicKI];
                        bool booleanDicU = booleanDicR.get(booleanDicK);
                        if (booleanDicV != booleanDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.booleanDic != null)
            {
                return(false);
            }
        }

        if (mData.intDic != null)
        {
            if (this.intDic == null)
            {
                return(false);
            }
            if (this.intDic.size() != mData.intDic.size())
            {
                return(false);
            }
            IntIntMap intDicR = mData.intDic;
            if (!this.intDic.isEmpty())
            {
                int   intDicKFreeValue = this.intDic.getFreeValue();
                int[] intDicKKeys      = this.intDic.getKeys();
                int[] intDicVValues    = this.intDic.getValues();
                for (int intDicKI = intDicKKeys.Length - 1; intDicKI >= 0; --intDicKI)
                {
                    int intDicK = intDicKKeys[intDicKI];
                    if (intDicK != intDicKFreeValue)
                    {
                        int intDicV = intDicVValues[intDicKI];
                        int intDicU = intDicR.get(intDicK);
                        if (intDicV != intDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.intDic != null)
            {
                return(false);
            }
        }

        if (mData.longDic != null)
        {
            if (this.longDic == null)
            {
                return(false);
            }
            if (this.longDic.size() != mData.longDic.size())
            {
                return(false);
            }
            IntLongMap longDicR = mData.longDic;
            if (!this.longDic.isEmpty())
            {
                int    longDicKFreeValue = this.longDic.getFreeValue();
                int[]  longDicKKeys      = this.longDic.getKeys();
                long[] longDicVValues    = this.longDic.getValues();
                for (int longDicKI = longDicKKeys.Length - 1; longDicKI >= 0; --longDicKI)
                {
                    int longDicK = longDicKKeys[longDicKI];
                    if (longDicK != longDicKFreeValue)
                    {
                        long longDicV = longDicVValues[longDicKI];
                        long longDicU = longDicR.get(longDicK);
                        if (longDicV != longDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.longDic != null)
            {
                return(false);
            }
        }

        if (mData.stringDic != null)
        {
            if (this.stringDic == null)
            {
                return(false);
            }
            if (this.stringDic.size() != mData.stringDic.size())
            {
                return(false);
            }
            SMap <string, string> stringDicR = mData.stringDic;
            if (!this.stringDic.isEmpty())
            {
                string[] stringDicKKeys   = this.stringDic.getKeys();
                string[] stringDicVValues = this.stringDic.getValues();
                for (int stringDicKI = stringDicKKeys.Length - 1; stringDicKI >= 0; --stringDicKI)
                {
                    string stringDicK = stringDicKKeys[stringDicKI];
                    if (stringDicK != null)
                    {
                        string stringDicV = stringDicVValues[stringDicKI];
                        string stringDicU = stringDicR.get(stringDicK);
                        if (stringDicV != stringDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.stringDic != null)
            {
                return(false);
            }
        }

        return(true);
    }
Ejemplo n.º 26
0
 /// <summary>
 /// 添加字典(热更用)
 /// </summary>
 public static void addDic(SMap <string, TextConfig> dic)
 {
     _dic.putAll(dic);
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Map包含
 /// </summary>
 public bool func_MapContains(TriggerExecutor e, TriggerArg a, SMap <object, object> map, object key)
 {
     return(map.contains(key));
 }
Ejemplo n.º 28
0
 /// <summary>
 /// 设置字典
 /// </summary>
 public static void setDic(SMap <string, TextConfig> dic)
 {
     _dic = dic;
 }
Ejemplo n.º 29
0
 /// <summary>
 /// 获取Map长度
 /// </summary>
 public int func_GetMapSize(TriggerExecutor e, TriggerArg a, SMap <object, object> map)
 {
     return(map.size());
 }
Ejemplo n.º 30
0
 /// <summary>
 /// 添加字典(热更用)
 /// </summary>
 public static void addDic(SMap <string, LanguageConfig> dic)
 {
     _dic.putAll(dic);
 }
Ejemplo n.º 31
0
 /// <summary>
 /// map添加
 /// </summary>
 public void func_MapPut(TriggerExecutor e, TriggerArg a, SMap <object, object> map, object key, object value)
 {
     map.put(key, value);
 }
Ejemplo n.º 32
0
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        stream.startReadObj();

        int booleanDicLen = stream.readLen();

        if (this.booleanDic != null)
        {
            this.booleanDic.clear();
            this.booleanDic.ensureCapacity(booleanDicLen);
        }
        else
        {
            this.booleanDic = new IntBooleanMap(booleanDicLen);
        }

        IntBooleanMap booleanDicT = this.booleanDic;

        for (int booleanDicI = booleanDicLen - 1; booleanDicI >= 0; --booleanDicI)
        {
            int  booleanDicK;
            bool booleanDicV;
            booleanDicK = stream.readInt();

            booleanDicV = stream.readBoolean();

            booleanDicT.put(booleanDicK, booleanDicV);
        }

        int intDicLen = stream.readLen();

        if (this.intDic != null)
        {
            this.intDic.clear();
            this.intDic.ensureCapacity(intDicLen);
        }
        else
        {
            this.intDic = new IntIntMap(intDicLen);
        }

        IntIntMap intDicT = this.intDic;

        for (int intDicI = intDicLen - 1; intDicI >= 0; --intDicI)
        {
            int intDicK;
            int intDicV;
            intDicK = stream.readInt();

            intDicV = stream.readInt();

            intDicT.put(intDicK, intDicV);
        }

        int longDicLen = stream.readLen();

        if (this.longDic != null)
        {
            this.longDic.clear();
            this.longDic.ensureCapacity(longDicLen);
        }
        else
        {
            this.longDic = new IntLongMap(longDicLen);
        }

        IntLongMap longDicT = this.longDic;

        for (int longDicI = longDicLen - 1; longDicI >= 0; --longDicI)
        {
            int  longDicK;
            long longDicV;
            longDicK = stream.readInt();

            longDicV = stream.readLong();

            longDicT.put(longDicK, longDicV);
        }

        int stringDicLen = stream.readLen();

        if (this.stringDic != null)
        {
            this.stringDic.clear();
            this.stringDic.ensureCapacity(stringDicLen);
        }
        else
        {
            this.stringDic = new SMap <string, string>(stringDicLen);
        }

        SMap <string, string> stringDicT = this.stringDic;

        for (int stringDicI = stringDicLen - 1; stringDicI >= 0; --stringDicI)
        {
            string stringDicK;
            string stringDicV;
            stringDicK = stream.readUTF();

            stringDicV = stream.readUTF();

            stringDicT.put(stringDicK, stringDicV);
        }

        stream.endReadObj();
    }
Ejemplo n.º 33
0
 public CSector(Integer PosX, Integer PosY, SMap Map) { }
Ejemplo n.º 34
0
 public MapHandler(SMap map)
 {
     Map = map;
 }
Ejemplo n.º 35
0
 public CHtmlGalaxyMap(SMap Map, SPoint StartPos, Integer Width, Integer Height) { }