private GameLocation addLocation(MapEdit edit) { GameLocation location; if (edit.type == "Deco") { location = new DecoratableLocation(Path.Combine("Maps", edit.name), edit.name); } else { location = new GameLocation(Path.Combine("Maps", edit.name), edit.name); } if (edit._map.Properties.ContainsKey("Outdoors") && edit._map.Properties["Outdoors"] == "F") { location.IsOutdoors = false; try { location.loadLights(); } catch { } location.IsOutdoors = false; } if (edit._map.Properties.ContainsKey("IsGreenHouse")) { location.IsGreenhouse = true; } if (edit._map.Properties.ContainsKey("IsStructure")) { location.isStructure.Value = true; } if (edit._map.Properties.ContainsKey("IsFarm")) { location.IsFarm = true; } if (!Game1.locations.Contains(location)) { Game1.locations.Add(location); } location.seasonUpdate(Game1.currentSeason); return(location); }
public TMXAssetEditor(MapEdit edit, Map map, EditType type) { this.edit = edit; this.type = type; this.newMap = map; this.assetName = edit is BuildableEdit be? be._mapName : edit.name; this.inLocation = null; if (edit is BuildableEdit b) { this.inLocation = b._location; } this.conditions = edit is BuildableEdit ? "" : edit.conditions; lastCheck = conditions == ""; }