Beispiel #1
0
    /// <summary>
    /// Resume last movement.
    /// </summary>
    /// <remarks>
    /// When <see cref="AllowReverse"/> is set to true, movement will resume in the
    /// opposite direction if <see cref="NextDirection"/> is also opposite of the current
    /// direction.
    /// </remarks>
    /// <seealso cref="Wait"/>
    public void Resume()
    {
        if (_allowedDirections == null)
        {
            return;
        }
        CurrentDirection   = _allowedDirections[0];
        _allowedDirections = null;

        if (AllowReverse && _nextDirection.IsOpposite(_currDirection))
        {
            CurrentDirection = _nextDirection;
        }
    }