Exemple #1
0
        public void Apply(PolusShipStatus shipStatus)
        {
            if (!MapHandler.Load())
            {
                return;
            }

            MapData      map     = MapHandler.GetMap();
            PolusHandler polus   = new PolusHandler(shipStatus);
            AssetBuilder builder = new AssetBuilder(polus);

            polus.ClearTasks();
            polus.MoveToTemp();

            for (int i = 0; i < map.objs.Length; i++)
            {
                MapAsset asset   = map.objs[i];
                bool     success = builder.Build(asset);
                if (!success)
                {
                    LILogger.LogError("Failed to build " + asset.name);
                }
                else if (i % 1000 == 0)
                {
                    LILogger.LogMsg(i + " - Objects");
                }
            }

            polus.DeleteTemp();
            LILogger.LogInfo("Applied Map Data");
        }
Exemple #2
0
        public void PreBuild(PolusShipStatus shipStatus)
        {
            // Load Map and AssetDB
            if (!AssetDB.Import())
            {
                return;
            }
            if (!MapHandler.Load())
            {
                return;
            }

            // Vars
            map     = MapHandler.GetMap();
            polus   = new PolusHandler(shipStatus);
            builder = new AssetBuilder(polus);
            MinimapGenerator.Reset();

            // Rooms
            LILogger.LogInfo("...Building Rooms");
            for (int i = 0; i < map.objs.Length; i++)
            {
                if (map.objs[i].type != "util-room")
                {
                    continue;
                }
                MapAsset asset   = map.objs[i];
                bool     success = builder.PreBuild(asset);
                if (!success)
                {
                    LILogger.LogError("Failed to build " + asset.name);
                }
            }

            // Objects
            LILogger.LogInfo("...Building Objects");
            for (int i = 0; i < map.objs.Length; i++)
            {
                if (map.objs[i].type == "util-room")
                {
                    continue;
                }
                MapAsset asset   = map.objs[i];
                bool     success = builder.PreBuild(asset);
                if (!success)
                {
                    LILogger.LogError("Failed to build " + asset.name);
                }
                else if (i % 100 == 0 && i != 0)
                {
                    LILogger.LogInfo("..." + i + " Objects Built");
                }
            }
        }