public bool TakeOwnership(IStateCancellation state)
        {
            StopCurrent();

            _state = state;
            return(true);
        }
 private bool StopCurrent()
 {
     if (_state == null)
     {
         return(false);
     }
     _state.StopState();
     _state = null;
     return(true);
 }
        public bool TakeOwnership(IStateCancellation asyncState)
        {
            var stopResult = StopSince(asyncState);

            if (!stopResult)
            {
                Debug.LogError($"CAN't STOP State's for token {GetType().Name}");
                return(false);
            }
            _states.Add(asyncState);
            return(true);
        }
 public bool StopSince(IStateCancellation asyncState)
 {
     return(StopAt(_states.IndexOf(asyncState)));
 }
        public bool StopAfter(IStateCancellation node)
        {
            var index = _states.IndexOf(node);

            return(StopAt(++index));
        }
 public void Dispose()
 {
     _context.Release();
     _state.StopState();
     _state = null;
 }
 public bool StopSince(IStateCancellation node)
 {
     return(StopCurrent());
 }