예제 #1
0
        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();
        }
예제 #2
0
 public void Enqueue(PotentialPath path)
 {
     this.PotentialPaths.Enqueue(path);
 }