예제 #1
0
 /// <summary>
 /// Constructor instantiates a new LivingUnit object given required parameters to describe the Unit.
 /// </summary>
 /// <remarks>
 /// Author: Rudy Ariaz
 /// </remarks>
 /// <param name="type">The type of Unit.</param>
 /// <param name="speciesComplexity">The complexity of the Unit's species.</param>
 /// <param name="senescence">The senescence value of the Unit.</param>
 /// <param name="foodRequirement">The food requirement of the Unit.</param>
 /// <param name="waterRequirement">The water requirement of the Unit.</param>
 /// <param name="gasRequirement">The gas requirement of the Unit.</param>
 /// <param name="inputGas">The input gas of the Unit.</param>
 /// <param name="outputGas">The output gas of the Unit.</param>
 /// <param name="idealTemperature">The ideal temperature of the Unit.</param>
 /// <param name="infectionResistance">The infection resistance of the Unit.</param>
 /// <param name="decompositionValue">The decomposition value of the Unit.</param>
 /// <param name="row">Optional: The row of the Unit (within the grid).</param>
 /// <param name="col">Optional: The column of the Unit (within the grid).</param>
 public LivingUnit(Enums.UnitType type, int speciesComplexity, int senescence, int foodRequirement,
                   int waterRequirement, int gasRequirement, Enums.GasType inputGas,
                   Enums.GasType outputGas, int idealTemperature, double infectionResistance,
                   double decompositionValue, int row = -1, int col = -1) : base(type, decompositionValue,
                                                                                 speciesComplexity, row, col)
 {
     // Set the senesence value
     Senescence = senescence;
     // Set the food requirement
     FoodRequirement = foodRequirement;
     // Set the water requirement
     WaterRequirement = waterRequirement;
     // Set the gas requirement
     GasRequirement = gasRequirement;
     // Set the input gas
     InputGas = inputGas;
     // Set the output gas
     OutputGas = outputGas;
     // Set the ideal temperature
     IdealTemperature = idealTemperature;
     // Set the infection resistance
     InfectionResistance = infectionResistance;
     // Update the max resistance if needed
     MaxResistance = Math.Max(MaxResistance, InfectionResistance);
     // Set the infection status to false
     Infected = false;
     // Initialize the number of generations left to be cured
     CuredGenerationsLeft = 0;
 }
예제 #2
0
 /// <summary>
 /// Creates a new multicellular organism
 /// </summary>
 /// <param name="type"> The type of the Unit (Animal or Plant) </param>
 /// <param name="senescence"> The maximum age of the unit </param>
 /// <param name="foodRequirement"> The amount of food required per generation to survive </param>
 /// <param name="waterRequirement"> The amount of water required per generation to survive </param>
 /// <param name="gasRequirement"> The amount of gas converted </param>
 /// <param name="inputGas"> The type of gas that is taken in from the environment </param>
 /// <param name="outputGas"> The type of gas that is returned to the environment </param>
 /// <param name="idealTemperature"> The ideal temperature of this unit </param>
 /// <param name="infectionResistance"> The amount of infection resistance of this unit </param>
 /// <param name="decompositionValue"> The amount of food the unit returns to the environment after death </param>
 /// <param name="row"> The row of the grid the unit resides in </param>
 /// <param name="col"> The column of the grid the unit resides in </param>
 public Multicellular(Enums.UnitType type, int senescence, int foodRequirement, int waterRequirement, int gasRequirement,
                      Enums.GasType inputGas, Enums.GasType outputGas, int idealTemperature,
                      double infectionResistance, double decompositionValue, int row = -1, int col = -1)
     : base(type, 4, senescence, foodRequirement, waterRequirement, gasRequirement,
            inputGas, outputGas, idealTemperature, infectionResistance, decompositionValue, row, col)
 {
 }
예제 #3
0
 /// <summary>
 /// Constructor used by child classes to create new instances of the clases. Uses
 /// base constructor of LivingUnit to assign all values.
 /// </summary>
 /// <param name="speciesComplexity">The species complexity of the Unit.</param>
 /// <param name="senescence">The senescence value of the Unit.</param>
 /// <param name="foodRequirement">The food requirement of the Unit.</param>
 /// <param name="waterRequirement">The water requirement of the Unit.</param>
 /// <param name="gasRequirement">The amount of gas requirement of the Unit.</param>
 /// <param name="inputGas">The input gas of the Unit.</param>
 /// <param name="outputGas">The output gas of the Unit.</param>
 /// <param name="idealTemperature">The ideal temperature of the Unit.</param>
 /// <param name="infectionResistance">The infection resistance of the Unit.</param>
 /// <param name="decompositionValue">The decomposition value of the Unit.</param>
 /// <param name="row">Optional: The row of the Unit (within the grid).</param>
 /// <param name="col">Optional: The column of the Unit (within the grid).</param>
 public MergeableUnit(Enums.UnitType type, int speciesComplexity, int senescence, int foodRequirement,
                      int waterRequirement, int gasRequirement, Enums.GasType inputGas,
                      Enums.GasType outputGas, int idealTemperature, double infectionResistance,
                      double decompositionValue, int row = -1, int col = -1) : base(type,
                                                                                    speciesComplexity: 2, senescence: 16,
                                                                                    foodRequirement: 1, waterRequirement: 1,
                                                                                    gasRequirement: 1, inputGas: Enums.GasType.Oxygen,
                                                                                    outputGas: Enums.GasType.CarbonDioxide, idealTemperature: 30,
                                                                                    infectionResistance: 3, decompositionValue: 0.5, row: row, col: col)
 {
 }