예제 #1
0
        public static void OnLoad()
        {
            for (int mapId = 0; mapId < RegrowthMasterLookupTable.Count; ++mapId)
            {
                string   filename     = Path.Combine(UltimaLiveSettings.LumberHarvestFallenTreeSaveLocation, "TreeLocations." + mapId);
                FileInfo treeFileInfo = new FileInfo(filename);

                if (treeFileInfo.Exists)
                {
                    using (FileStream fs = new FileStream(filename, FileMode.Open))
                    {
                        using (BinaryReader br = new BinaryReader(fs))
                        {
                            GenericReader reader = new BinaryFileReader(br);

                            while (fs.Position < fs.Length)
                            {
                                Point3D p      = reader.ReadPoint3D();
                                int     itemId = reader.ReadInt();
                                if (!RegrowthMasterLookupTable[mapId].ContainsKey(p))
                                {
                                    RegrowthMasterLookupTable[mapId].Add(p, itemId);
                                }
                            }
                        }
                    }
                }
            }
        }