private void LoadItems() { if (pageState == RuinsPageState.LoadedHeader) { pageState = RuinsPageState.LoadingBlueprints; SnapshotManager manager = new SnapshotManager(); manager.Progress = delegate(int progress, int total) { blueprintsLoadedCount = progress; blueprintsToLoadCount = total; }; manager.Completion = delegate(bool success) { Debug.Log(Debug.POI, "Completed loading, creating sites."); pageState = RuinsPageState.ProcessingBlueprints; new Thread(() => { CreateSites(); pageState = RuinsPageState.Completed; }).Start(); }; Debug.Log(Debug.POI, "Loading blueprints one by one..."); manager.AggressiveLoadSnaphotsFromList(blueprintIds, gamePath: SnapshotStoreManager.CurrentGamePath(), loadIfExists: false); } }
private void CreateSites() { foreach (PlanetTileInfo t in mapTiles) { blueprintsProcessedCount++; if (biomeStrict) { if (t.originX == 0 && t.originZ == 0 || t.biomeName == null) { continue; } } try { if (RealRuinsPOIFactory.CreatePOI(t, SnapshotStoreManager.CurrentGamePath(), biomeStrict, costStrict, areaStrict)) { blueprintsUsed++; } } catch { //just skip blueprint } } }