private static int GetSeedPart(List <GenStepWithParams> genSteps, int index) { GenStepWithParams genStepWithParams = genSteps[index]; int seedPart = genStepWithParams.def.genStep.SeedPart; int num = 0; for (int i = 0; i < index; i++) { GenStepWithParams genStepWithParams2 = tmpGenSteps[i]; if (genStepWithParams2.def.genStep.SeedPart == seedPart) { num++; } } return(seedPart + num); }
public static void GenerateContentsIntoMap(IEnumerable <GenStepWithParams> genStepDefs, Map map, int seed) { data.Clear(); Rand.PushState(); try { Rand.Seed = seed; RockNoises.Init(map); tmpGenSteps.Clear(); tmpGenSteps.AddRange(from x in genStepDefs orderby x.def.order, x.def.index select x); for (int i = 0; i < tmpGenSteps.Count; i++) { GenStepWithParams genStepWithParams = tmpGenSteps[i]; DeepProfiler.Start("GenStep - " + genStepWithParams.def); try { Rand.Seed = Gen.HashCombineInt(seed, GetSeedPart(tmpGenSteps, i)); GenStepWithParams genStepWithParams2 = tmpGenSteps[i]; GenStep genStep = genStepWithParams2.def.genStep; GenStepWithParams genStepWithParams3 = tmpGenSteps[i]; genStep.Generate(map, genStepWithParams3.parms); } catch (Exception arg) { Log.Error("Error in GenStep: " + arg); } finally { DeepProfiler.End(); } } } finally { Rand.PopState(); RockNoises.Reset(); data.Clear(); } }
private static ushort <GenerateContentsIntoMap> m__2(GenStepWithParams x) { return(x.def.index); }
private static float <GenerateContentsIntoMap> m__1(GenStepWithParams x) { return(x.def.order); }