/// <summary>
        /// Initializes a new instance of the <see cref="PathService"/> class.
        /// </summary>
        /// <param name="engine">The engine.</param>
        /// <param name="threadFactory">The thread factory.</param>
        /// <param name="useThreadPoolForAsync">if set to <c>true</c> the thread pool will be used for async operation.</param>
        public PathService(IPathingEngine engine, IThreadFactory threadFactory, bool useThreadPoolForAsync)
        {
            Ensure.ArgumentNotNull(engine, "engine");
            Ensure.ArgumentNotNull(threadFactory, "threadFactory");

            _stopwatch = new Stopwatch();
            _queue = new PriorityQueueFifo<IPathRequest>(StartQueueSize, QueueType.Max);
            _engine = engine;

            _threadPoolSupported = useThreadPoolForAsync;

#if !NETFX_CORE
            _threadFactory = threadFactory;
#endif
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PathService"/> class.
        /// </summary>
        /// <param name="engine">The engine.</param>
        /// <param name="threadFactory">The thread factory.</param>
        /// <param name="useThreadPoolForAsync">if set to <c>true</c> the thread pool will be used for async operation.</param>
        public PathService(IPathingEngine engine, IThreadFactory threadFactory, bool useThreadPoolForAsync)
        {
            Ensure.ArgumentNotNull(engine, "engine");
            Ensure.ArgumentNotNull(threadFactory, "threadFactory");

            _stopwatch = new Stopwatch();
            _queue     = new PriorityQueueFifo <IPathRequest>(StartQueueSize, QueueType.Max);
            _engine    = engine;

            _threadPoolSupported = useThreadPoolForAsync;

#if !NETFX_CORE
            _threadFactory = threadFactory;
#endif
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathService"/> class.
 /// </summary>
 /// <param name="engine">The engine.</param>
 /// <param name="directPather">The direct pather.</param>
 /// <param name="threadFactory">The thread factory.</param>
 public PathService(IPathingEngine engine, IDirectPather directPather, IThreadFactory threadFactory)
     : this(engine, directPather, threadFactory, true)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PathService"/> class.
 /// </summary>
 /// <param name="engine">The engine.</param>
 /// <param name="threadFactory">The thread factory.</param>
 public PathService(IPathingEngine engine, IThreadFactory threadFactory)
     : this(engine, threadFactory, true)
 {
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathService"/> class.
 /// </summary>
 /// <param name="engine">The engine.</param>
 /// <param name="directPather">The direct pather.</param>
 /// <param name="threadFactory">The thread factory.</param>
 public PathService(IPathingEngine engine, IDirectPather directPather, IThreadFactory threadFactory)
     : this(engine, directPather, threadFactory, true)
 {
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathService"/> class.
 /// </summary>
 /// <param name="engine">The engine.</param>
 /// <param name="threadFactory">The thread factory.</param>
 public PathService(IPathingEngine engine, IThreadFactory threadFactory)
     : this(engine, threadFactory, true)
 {
 }