Beispiel #1
0
        public override IPathfinder <DefinitionNodeGrid, DijkstraNodeGrid, PotentialField> CreatePathfinder()
        {
            var definitionNodeNetwork = GetDefinitionNodeNetwork();

            if (definitionNodeNetwork == null)
            {
                throw new NoDefinitionNodeNetworkException();
            }
            return(PathfinderFactory.CreatePotentialFieldPathfinder(PathfindaxDualityCorePlugin.PathfindaxManager, definitionNodeNetwork, MaxClearance, MaxCachedFlowFields, AmountOfThreads));
        }
Beispiel #2
0
 public override IPathfinder <DefinitionNodeGrid, DijkstraNodeGrid, PotentialField> CreatePathfinder()
 {
     try
     {
         var definitionNodeNetwork = GetDefinitionNodeNetwork();
         if (definitionNodeNetwork == null)
         {
             throw new NoDefinitionNodeNetworkException();
         }
         return(PathfinderFactory.CreatePotentialFieldPathfinder(PathfindaxDualityCorePlugin.PathfindaxManager, definitionNodeNetwork, MaxClearance, MaxCachedFlowFields, AmountOfThreads));
     }
     catch (Exception e)
     {
         Logs.Game.WriteError($"Could not generate the definitionnode network. Returning a dummy pathfinder that does nothing. The following error occurred: {LogFormat.Exception(e)}.");
         return(new DummyPathfinder <DefinitionNodeGrid, DijkstraNodeGrid, PotentialField>());
     }
 }