Example #1
0
 public Pheromone(int colonyID, String location, PheromoneEnum type, bool loaded = false)
 {
     StrengthProperty = MAX;
     LocationProperty = location;
     TypeProperty     = type;
     ColonyIDProperty = colonyID;
     FullPathProperty = LocationProperty + @"\" + TypeProperty + "_" + ColonyIDProperty.ToString("D2") + ".phe";
     if (!File.Exists(FullPathProperty) && loaded == false)
     {
         // Create a file to write to.
         using (StreamWriter sw = File.CreateText(FullPathProperty))
         {
             sw.WriteLine(this.StrengthProperty);
             sw.Close();
         }
     }
 }
Example #2
0
 public Pheromone(int colonyID, String location, PheromoneEnum type, bool loaded = false)
 {
     StrengthProperty = MAX;
     LocationProperty = location;
     TypeProperty = type;
     ColonyIDProperty = colonyID;
     FullPathProperty = LocationProperty + @"\" + TypeProperty + "_" + ColonyIDProperty.ToString("D2") + ".phe";
     if (!File.Exists(FullPathProperty) && loaded == false)
     {
         // Create a file to write to.
         using (StreamWriter sw = File.CreateText(FullPathProperty))
         {
             sw.WriteLine(this.StrengthProperty);
             sw.Close();
         }
     }
 }