Exemplo n.º 1
0
        public bool TakeOwnership(IStateCancellation state)
        {
            StopCurrent();

            _state = state;
            return(true);
        }
Exemplo n.º 2
0
 private bool StopCurrent()
 {
     if (_state == null)
     {
         return(false);
     }
     _state.StopState();
     _state = null;
     return(true);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public bool StopSince(IStateCancellation asyncState)
 {
     return(StopAt(_states.IndexOf(asyncState)));
 }
Exemplo n.º 5
0
        public bool StopAfter(IStateCancellation node)
        {
            var index = _states.IndexOf(node);

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