public Region CreateRegion(RegionInfo info, SaveData data) { var region = new Region(RegionNames.Test1); for (int i = 0; i < info.ZoneTileSizes.Count; i++) { var zone = new Zone(info.ZoneTileSizes[i], info.ZoneLevels[i]); region.Zones.Add(zone); } region.Zones[0].SceneryObjects.Add(SceneryMapper.CreateSceneryObject(SceneryNames.Test1Level0Top, new Vector2(0, 0), 0)); region.Zones[0].SceneryObjects.Add(SceneryMapper.CreateSceneryObject(SceneryNames.Test1Level0Bottom, new Vector2(0, 1800), 0)); return(region); }
public Region CreateRegion(RegionInfo info, SaveData data) { var region = new Region(RegionNames.Test0); // i don't think we actually want to do this for (int i = 0; i < info.ZoneTileSizes.Count; i++) { var zone = new Zone(info.ZoneTileSizes[i], info.ZoneLevels[i]); region.Zones.Add(zone); } // where should the scenery indexes come from? region.Zones[0].SceneryObjects.Add(SceneryMapper.CreateSceneryObject(SceneryNames.Test0Level0, new Vector2(0, 0), 0)); return(region); }
// need to know the npcs to load, the scenery to load, the objects to load public static List <RegionContent> LoadContentForRegions(IServiceProvider serviceProvider, string rootDirectory, List <RegionNames> regions) { var regionContentList = new List <RegionContent>(); foreach (var region in regions) { var regionContent = new RegionContent(); var contentManager = new ContentManager(serviceProvider, rootDirectory); regionContent.Region = region; regionContent.NpcTextures = NpcContentLoader.LoadNpcsForRegion(contentManager, region); regionContent.ObjectTextures = LoadObjectTextures(contentManager, region); // don't need an object mapper because each object has it's own class regionContent.SceneryTextures = SceneryMapper.LoadSceneryTextures(contentManager, region); regionContent.SoundEffects = SoundMapper.LoadSoundsForRegion(contentManager, region); regionContent.ContentManager = contentManager; regionContentList.Add(regionContent); } return(regionContentList); }