예제 #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);