protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _pathfinder.Dispose(); } _blackListedElements.Clear(); _blackListedElements = null; _elementToGather = null; _pathfinder = null; _account = null; _disposedValue = true; } }
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); } }
public void CancelGather() => _elementToGather = null;
public void Clear() { _elementToGather = null; _blackListedElements.Clear(); _stolen = false; }
private void OnGatherFinished(GatherResults result) { _stolen = false; _elementToGather = null; GatherFinished?.Invoke(result); }
// Constructor public ElementInCellEntry(InteractiveElementEntry element, short cellId) { Element = element; CellId = cellId; }