Ejemplo n.º 1
0
    /// <summary>
    ///   Creates a fully random species starting with one cytoplasm
    /// </summary>
    public MicrobeSpecies CreateRandomSpecies(MicrobeSpecies mutated, int steps = 5)
    {
        // Temporarily create species with just cytoplasm to start mutating from
        var temp = new MicrobeSpecies(int.MaxValue);

        GameWorld.SetInitialSpeciesProperties(temp);

        // TODO: in the old code GenerateNameSection was used to
        // override the default species name here

        for (int step = 0; step < steps; ++step)
        {
            CreateMutatedSpecies(temp, mutated);
            temp = (MicrobeSpecies)mutated.Clone();
        }

        return(mutated);
    }
Ejemplo n.º 2
0
    /// <summary>
    ///   Creates a fully random species starting with one cytoplasm
    /// </summary>
    public MicrobeSpecies CreateRandomSpecies(MicrobeSpecies mutated, int steps = 5)
    {
        // Temporarily create species with just cytoplasm to start mutating from
        var temp = new MicrobeSpecies(int.MaxValue);

        GameWorld.SetInitialSpeciesProperties(temp);

        // Override the default species starting name to have more variability in the names
        var nameGenerator = SimulationParameters.Instance.NameGenerator;

        temp.Epithet = nameGenerator.GenerateNameSection();
        temp.Genus   = nameGenerator.GenerateNameSection();

        for (int step = 0; step < steps; ++step)
        {
            CreateMutatedSpecies(temp, mutated);
            temp = (MicrobeSpecies)mutated.Clone();
        }

        return(mutated);
    }