Exemple #1
0
 /// <summary>
 /// Set basic parameters for a creature type.
 /// </summary>
 /// <param name="ce">Creature wrapper.</param>
 /// <param name="name">Name of creature.</param>
 /// <param name="phenotype">Phenotype of creature (potentially sensed by other creatures).</param>
 /// <param name="turnTime">The amount of time given for a creature's turn. It's recommended to use the same turn time for all creatures.</param>
 /// <param name="maxHealth">The maximum possible health a creature can achieve.</param>
 /// <param name="initialHealth">The initial health of the creature when a population is created. Note that a child inherits the health of it's parent, and doesn't use this value.</param>
 /// <param name="actionClearInterval">The action queue is cleared at intervals of this number of steps.</param>
 /// <param name="actionClearSize">The size that the action queue must reach before it is cleared.</param>
 /// <param name="mutationDeviation">The initial amount of mutation that occurs with reproduction.</param>
 /// <param name="color">The color of the creature.</param>
 /// <param name="usePhenoNet">Chose wether creature should sense the phenotypes of it's neighbors. If so, you must create a phenotype network template.</param>
 /// <param name="mutationDeviationFraction">The number that the mutation deviation is multiplied by each time a creature reproduces. This new deviation is passed on to the child. This can be used to slowy reduce the amount of variability in the population.</param>
 /// <param name="lowestMutationDeviation">The lowest value that the mutation deviation can reach, even with the mutationDeviationFraction.</param>
 /// <param name="mutationType">The type of mutation being used.</param>
 public static void setCreatureStats(CreatureEditor ce, string name, int phenotype, float turnTime, float maxHealth, float initialHealth,
                                     int actionClearInterval, int actionClearSize, float mutationDeviation, ColorChoice color, bool usePhenoNet,
                                     float mutationDeviationFraction, float lowestMutationDeviation, MutationDeviationCoefficientType mutationType)
 {
     ce.setSpecies(name);
     ce.setPhenotype(phenotype);
     ce.setTurnTime(turnTime);
     ce.setMaxHealth(maxHealth);
     ce.setInitialHealth(initialHealth);
     ce.setActionClearInterval(actionClearInterval);
     ce.setActionClearSize(actionClearSize);
     ce.setMutationStandardDeviation(mutationDeviation);
     ce.setColor(color);
     ce.setUsePhenotypeNet(usePhenoNet);
     ce.setAnnealMutationFraction(mutationDeviationFraction);
     ce.setBaseMutationDeviation(lowestMutationDeviation);
     ce.setMutationCoeffType(mutationType);
 }