Example #1
0
        bool _loadMap(uint mapId, uint tileX, uint tileY)
        {
            var instanceTree = iInstanceMapTrees.LookupByKey(mapId);

            if (instanceTree == null)
            {
                string        filename = string.Format("{0}{1:D4}.vmtree", VMapPath, mapId);
                StaticMapTree newTree  = new StaticMapTree(mapId);
                if (!newTree.InitMap(filename, this))
                {
                    return(false);
                }

                iInstanceMapTrees.Add(mapId, newTree);

                instanceTree = newTree;
            }

            return(instanceTree.LoadMapTile(tileX, tileY, this));
        }
Example #2
0
        bool loadSingleMap(uint mapId, uint tileX, uint tileY)
        {
            var instanceTree = iInstanceMapTrees.LookupByKey(mapId);

            if (instanceTree == null)
            {
                string        filename = VMapPath + getMapFileName(mapId);
                StaticMapTree newTree  = new StaticMapTree(mapId);
                if (!newTree.InitMap(filename))
                {
                    return(false);
                }

                iInstanceMapTrees.Add(mapId, newTree);

                instanceTree = newTree;
            }

            return(instanceTree.LoadMapTile(tileX, tileY, this));
        }
Example #3
0
        LoadResult LoadSingleMap(uint mapId, uint tileX, uint tileY)
        {
            var instanceTree = iInstanceMapTrees.LookupByKey(mapId);

            if (instanceTree == null)
            {
                string        filename       = VMapPath + GetMapFileName(mapId);
                StaticMapTree newTree        = new StaticMapTree(mapId);
                LoadResult    treeInitResult = newTree.InitMap(filename);
                if (treeInitResult != LoadResult.Success)
                {
                    return(treeInitResult);
                }

                iInstanceMapTrees.Add(mapId, newTree);

                instanceTree = newTree;
            }

            return(instanceTree.LoadMapTile(tileX, tileY, this));
        }