Beispiel #1
0
        // 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];
        }
Beispiel #2
0
        // 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];
            }
        }