public void Procces() { Add(SafePath.NoPath); var processors = new List <Processor>() { new DrinkBeerProcessor(), new ToMineProcessor(), new ToTavernPorcessor(), }; foreach (var processor in processors) { processor.Initialize(this.Map, this.State); } Enqueue(PotentialPath.Initial(this.Source, this.Map, this.State)); while (this.PotentialPaths.Count > 0) { var potentialPath = this.PotentialPaths.Dequeue(); foreach (var processor in processors) { processor.Process(potentialPath, this); } } // order them. Sort(); }
public void Enqueue(PotentialPath path) { this.PotentialPaths.Enqueue(path); }