public override void Apply(ZoneGenContext zoneContext, IGenContext context, StablePriorityQueue <Priority, IGenStep> queue) { SpawnDict <string, SpawnList <InvItem> > spawns = new SpawnDict <string, SpawnList <InvItem> >(); //contains all LISTS that intersect the current ID foreach (string key in Spawns.Keys) { //get all items within the spawnrangelist that intersect the current ID SpawnList <InvItem> slicedList = Spawns[key].Spawns.GetSpawnList(zoneContext.CurrentID); // add the spawnlist under the current key, with the key having the spawnrate for this id if (slicedList.CanPick && Spawns[key].SpawnRates.ContainsItem(zoneContext.CurrentID) && Spawns[key].SpawnRates[zoneContext.CurrentID] > 0) { spawns.Add(key, slicedList, Spawns[key].SpawnRates[zoneContext.CurrentID]); } } ItemSpawnStep <BaseMapGenContext> spawnStep = new ItemSpawnStep <BaseMapGenContext>(); spawnStep.Spawns = spawns; queue.Enqueue(Priority, spawnStep); }
public ItemSpawnStep() { Spawns = new SpawnDict <string, SpawnList <InvItem> >(); }