Пример #1
0
 internal void SetPlantToPosition(Plant plant)
 {
     _plantLandscape[plant.Location.Y, plant.Location.X] = plant;
 }
Пример #2
0
 private void RemovePlantFromPlane(Plant plant)
 {
     _plantLandscape[plant.Location.Y, plant.Location.X] = null;
 }
Пример #3
0
 private void AddPlantOnPlane(Plant plant)
 {
     var agentLocation = FindEmptySpot(_plantLandscape);
     plant.Location = agentLocation;
     _plantLandscape[agentLocation.Y, agentLocation.X] = plant;
 }
Пример #4
0
 private void InitPlants()
 {
     for (int plantIndex = 0; plantIndex < MaxPlants; plantIndex++)
     {
         var newPlant = new Plant();
         Plants[plantIndex] = newPlant;
         AddPlantOnPlane(newPlant);
     }
 }
Пример #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);