Пример #1
0
 /// <summary>
 /// Alternate Constructor for the Enviroment Class
 /// </summary>
 /// <param name="name">Name of Enviroment</param>
 /// <param name="startingTemp">Temperature that the enviroment will start at</param>
 /// <param name="substancesFileName">File name of the file where the substances data for the enviroment is stored</param>
 /// <param name="speciesFileName">Name of file where the data for the species that will live in the enviroment is stored</param>
 /// <param name="volume">Total Enviroment of the Enviroment</param>
 public Enviroment(string name, int startingTemp, string substancesFileName, string speciesFileName, int volume)
 {
     this.name        = name;
     this.temperature = startingTemp;
     this.substances  = TextParsers.ParseSubstances(substancesFileName);
     this.species     = TextParsers.ParseSpecies(speciesFileName);
     this.volume      = volume;
 }
Пример #2
0
 /// <summary>
 /// Constructor for Enviroment class
 /// </summary>
 /// <param name="name">Name of Enviroment</param>
 /// <param name="startingTemp">Temperature that the enviroment will start at</param>
 /// <param name="substancesFileName">File name of the file where the substances data for the enviroment is stored</param>
 /// <param name="speciesFileName">Name of file where the data for the species that will live in the enviroment is stored</param>
 /// <param name="length">Length of the enviroment</param>
 /// <param name="width">Width of the enviroment</param>
 /// <param name="height">Height of the enviroment</param>
 public Enviroment(string name, int startingTemp, string substancesFileName, string speciesFileName, int length, int width, int height)
 {
     this.name        = name;
     this.temperature = startingTemp;
     this.currentTime = 0;
     substances       = TextParsers.ParseSubstances(substancesFileName);
     species          = TextParsers.ParseSpecies(speciesFileName);
     this.volume      = length * width * height;
 }
Пример #3
0
 /// <summary>
 /// Constructor for a species
 /// </summary>
 /// <param name="Name">Name of the species</param>
 /// <param name="DNA">String of text which represents the DNA for the organism</param>
 public Species(string Name, string DNA, int currentTime)
 {
     this.name             = Name;
     this.DNA              = DNA;
     this.DNADic           = null;
     this.population       = 1;
     this.subSpecies       = new Dictionary <string, SubSpecies>();
     this.substances       = TextParsers.GetSubstancesFromDNA(DNA);
     this.DNADic           = TextParsers.GetDNACodesFromDNA(DNA);
     this.lifeSpan         = FindLifeSpan();
     this.generationsAlive = 0;
     this.startingTime     = currentTime;
     isAlive = true;
 }
Пример #4
0
 public static void GetAllSubstancesFromFile()
 {
     allSubstances = TextParsers.ParseSubstances(substancesFile);
 }