public void setUpNewYearDispersalMap(DateTime now, AnimalManager am) { //Because this is happening at the yearly time change the simulation //manager will handle making the new animal maps. try { mLog.Debug("inside setUpNewYearDispersalMap(DateTime now, AnimalManager am) calling changeMap(now)"); this.changeMap(now); if (changeMaps == true) { InitialAnimalAttributes[] inIAA; MapManager.GetUniqueInstance().GetInitialAnimalAttributes(out inIAA); am.addNewDispersers(inIAA, now); } } catch (System.Exception ex) { eLog.Debug(ex); #if (DEBUG) System.Windows.Forms.MessageBox.Show(ex.Message); #endif } }
public void changeMap(DateTime now, AnimalManager am) { try { mLog.Debug("inside changeMap(DateTime now, AnimalManager am) calling changeMap(now)"); string previousMapName = MapManager.GetUniqueInstance().SocialMap.FullFileName; this.changeMap(now); if (this.mMapType == "Social" && changeMaps == true) { am.adjustNewSocialMap(MapManager.GetUniqueInstance().SocialMap); } else if (this.mMapType == "Dispersal" && changeMaps == true) { mLog.Debug("MapType is Dispersal and changeMaps == true so need to make newly released animals"); InitialAnimalAttributes[] inIAA; MapManager.GetUniqueInstance().GetInitialAnimalAttributes(out inIAA); //int numNewDispersers = inIAA.Length; int numNewDispersers = 0; for (int animal = 0; animal < inIAA.Length; animal++) { numNewDispersers += inIAA[animal].NumToMake; } am.addNewDispersers(inIAA, now); mLog.Debug("Back from the animal manager making new animals"); mLog.Debug("trigger type is " + this.mMyTriggers[0].MyTriggerType.ToString()); MapManager.GetUniqueInstance().makeNewDisperserAnimalMaps(numNewDispersers); } } catch (System.Exception ex) { eLog.Debug(ex); #if (DEBUG) System.Windows.Forms.MessageBox.Show(ex.Message); #endif } }