Пример #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposedValue)
            {
                if (disposing)
                {
                    _pathfinder.Dispose();
                }

                _blackListedElements.Clear();
                _blackListedElements = null;
                _elementToGather     = null;
                _pathfinder          = null;
                _account             = null;

                _disposedValue = true;
            }
        }
Пример #2
0
        private bool MoveToElement(KeyValuePair <InteractiveElementEntry, short> element)
        {
            _elementToGather = element.Key;

            // Assuming there is no way statedElem will be null
            switch (_account.Game.Managers.Movements.MoveToCell(element.Value, true))
            {
            case MovementRequestResults.MOVED:
                _account.Logger.LogDebug(LanguageManager.Translate("133"), LanguageManager.Translate("122", element.Value, element.Key.Id));
                return(true);

            case MovementRequestResults.ALREADY_THERE:
                TryUsingElementToGather();
                return(true);

            default:     // FAILED
                CancelGather();
                return(false);
            }
        }
Пример #3
0
 public void CancelGather()
 => _elementToGather = null;
Пример #4
0
 public void Clear()
 {
     _elementToGather = null;
     _blackListedElements.Clear();
     _stolen = false;
 }
Пример #5
0
 private void OnGatherFinished(GatherResults result)
 {
     _stolen          = false;
     _elementToGather = null;
     GatherFinished?.Invoke(result);
 }
Пример #6
0
 // Constructor
 public ElementInCellEntry(InteractiveElementEntry element, short cellId)
 {
     Element = element;
     CellId  = cellId;
 }