// Runtime constructor public LandClassLoader(PQSLandControl.LandClass landClass) { this.landClass = landClass; altitudeRange = new LerpRangeLoader(landClass.altitudeRange); latitudeDoubleRange = new LerpRangeLoader(landClass.latitudeDoubleRange); latitudeRange = new LerpRangeLoader(landClass.latitudeRange); longitudeRange = new LerpRangeLoader(landClass.longitudeRange); coverageSimplex = new SimplexLoader(landClass.coverageSimplex); noiseSimplex = new SimplexLoader(landClass.noiseSimplex); }
// Creates the a PQSMod of type T with given PQS public override void Create(PQS pqsVersion) { base.Create(pqsVersion); // Create mod components Continental = new SimplexLoader(); ContinentalRuggedness = new SimplexLoader(); ContinentalSharpness = new NoiseModLoader(); ContinentalSharpnessMap = new SimplexLoader(); TerrainType = new SimplexLoader(); // Create the callback list LandClasses = new CallbackList <LandClassLoader>(e => { Mod.landClasses = LandClasses.Where(landClass => !landClass.Delete) .Select(landClass => landClass.Value).ToArray(); }); Mod.landClasses = new PQSMod_VertexPlanet.LandClass[0]; }
// Apply event void IParserEventSubscriber.Apply(ConfigNode node) { altitudeSimplex = new SimplexLoader(mod.altitudeSimplex); latitudeSimplex = new SimplexLoader(mod.latitudeSimplex); longitudeSimplex = new SimplexLoader(mod.longitudeSimplex); }
// Grabs a PQSMod of type T from a parameter with a given PQS public override void Create(PQSMod_VertexPlanet mod, PQS pqsVersion) { base.Create(mod, pqsVersion); // Create mod components if (Continental == null) { Continental = new SimplexLoader(); } else if (Mod.continental.GetType() == typeof(PQSMod_VertexPlanet.SimplexWrapper)) { Continental = new SimplexLoader(Mod.continental); } if (ContinentalRuggedness == null) { ContinentalRuggedness = new SimplexLoader(); } else if (Mod.continentalRuggedness.GetType() == typeof(PQSMod_VertexPlanet.SimplexWrapper)) { ContinentalRuggedness = new SimplexLoader(Mod.continentalRuggedness); } if (ContinentalSharpness == null) { ContinentalSharpness = new NoiseModLoader(); } if (ContinentalSharpnessMap == null) { ContinentalSharpnessMap = new SimplexLoader(); } else if (Mod.continentalSharpnessMap.GetType() == typeof(PQSMod_VertexPlanet.SimplexWrapper)) { ContinentalSharpnessMap = new SimplexLoader(Mod.continentalSharpnessMap); } if (TerrainType == null) { TerrainType = new SimplexLoader(); } else if (Mod.terrainType.GetType() == typeof(PQSMod_VertexPlanet.SimplexWrapper)) { TerrainType = new SimplexLoader(Mod.terrainType); } // Create the callback list LandClasses = new CallbackList <LandClassLoader>(e => { Mod.landClasses = LandClasses.Where(landClass => !landClass.Delete) .Select(landClass => landClass.Value).ToArray(); }); // Load LandClasses if (Mod.landClasses != null) { for (Int32 i = 0; i < Mod.landClasses.Length; i++) { // Only activate the callback if we are adding the last loader LandClasses.Add(new LandClassLoader(Mod.landClasses[i]), i == Mod.landClasses.Length - 1); } } else { Mod.landClasses = new PQSMod_VertexPlanet.LandClass[0]; } }