Beispiel #1
0
 internal void SetPlantToPosition(Plant plant)
 {
     _plantLandscape[plant.Location.Y, plant.Location.X] = plant;
 }
Beispiel #2
0
 private void RemovePlantFromPlane(Plant plant)
 {
     _plantLandscape[plant.Location.Y, plant.Location.X] = null;
 }
Beispiel #3
0
 private void AddPlantOnPlane(Plant plant)
 {
     var agentLocation = FindEmptySpot(_plantLandscape);
     plant.Location = agentLocation;
     _plantLandscape[agentLocation.Y, agentLocation.X] = plant;
 }
Beispiel #4
0
 private void InitPlants()
 {
     for (int plantIndex = 0; plantIndex < MaxPlants; plantIndex++)
     {
         var newPlant = new Plant();
         Plants[plantIndex] = newPlant;
         AddPlantOnPlane(newPlant);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Add a new plant to the SimObjects list
 /// </summary>
 /// <param name="plant">Plant object</param>
 public void AddPlant(Plant plant) => SimObjects.Add(plant);