Esempio n. 1
0
 private void PlantCallBack(PlantBox box, SeedBox seedBox)
 {
     if (box == null || seedBox == null)
     {
         return;
     }
     if (box.IsFull || !seedBox.IsFull)
     {
         return;
     }
     box.PlantSeed(seedBox._currentSeed);
     seedBox.RemoveSeed();
     SaveSeeds();
 }
Esempio n. 2
0
 private void SeedDroppedEvent(SeedBox _seedBox, SeedBox _selectBox)
 {
     if (_selectBox == null || _seedBox == null)
     {
         return;
     }
     if (_selectBox.IsFull && _seedBox.IsFull)
     {
         // Merge seeds attempt
         SeedController.Instance.MergeSeeds(_selectedBox._currentSeed, _seedBox._currentSeed, (s) => {
             _seedBox.PlaceSeed(s);
             _selectBox.RemoveSeed();
         }, () => {
         });
     }
     else if (!_seedBox.IsFull && _selectBox.IsFull)
     {
         // Move seed from box
         _seedBox.PlaceSeed(_selectedBox._currentSeed);
         _selectedBox.RemoveSeed();
     }
     SaveSeeds();
 }
 public void SelectSeedBox(SeedBox seedBox)
 {
     if (_currentlySelectedSeed != null && _lastSelectedSeedBox != null)
     {
         SeedController.Instance.MergeSeeds(seedBox._currentSeed, _currentlySelectedSeed, (s) => {
             seedBox.PlaceSeed(s);
             _lastSelectedSeedBox.RemoveSeed();
             _lastSelectedSeedBox   = null;
             _currentlySelectedSeed = null;
         }, () => {
             _currentlySelectedSeed = null;
             _lastSelectedSeedBox   = null;
         });
     }
     else
     {
         _lastSelectedSeedBox   = seedBox;
         _currentlySelectedSeed = seedBox._currentSeed;
     }
 }