示例#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);