From e7e3658c970e8da46072d085093d1ce9bd6df5c6 Mon Sep 17 00:00:00 2001 From: ryuga4 Date: Mon, 13 May 2019 17:34:23 +0200 Subject: [PATCH] szybciej --- Trunk/MonoGameView/Algorithms/BFS.cs | 4 ++-- Trunk/MonoGameView/Algorithms/DFS.cs | 2 +- Trunk/MonoGameView/Game1.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Trunk/MonoGameView/Algorithms/BFS.cs b/Trunk/MonoGameView/Algorithms/BFS.cs index 3473ce8..3a59fb2 100644 --- a/Trunk/MonoGameView/Algorithms/BFS.cs +++ b/Trunk/MonoGameView/Algorithms/BFS.cs @@ -142,14 +142,14 @@ namespace MonoGameView.Algorithms foreach (var item in nodes) { // Thread.Sleep(100); - /*this.Collector.Coords = item.Item2.Coords; + this.Collector.Coords = item.Item2.Coords; for (int x = 0; x < item.Item3.GetLength(0); x++) { for (int y = 0; y < item.Item3.GetLength(1); y++) { this.Grid[x, y] = item.Item3[x, y]; } - }*/ + } if (Houses.All(c => (item.Item3[c.X, c.Y] as IGarbageLocalization).TrashCans.All(j => j.FillPercent == 0.0)) && diff --git a/Trunk/MonoGameView/Algorithms/DFS.cs b/Trunk/MonoGameView/Algorithms/DFS.cs index 36c952f..90a4dff 100644 --- a/Trunk/MonoGameView/Algorithms/DFS.cs +++ b/Trunk/MonoGameView/Algorithms/DFS.cs @@ -127,7 +127,7 @@ namespace CzokoŚmieciarka.MonoGameView.Algorithms KeyValuePair, int> Search(ContentManager content, GarbageCollector collector, ICloneable[,] grid, int length) { - Thread.Sleep(100); + //Thread.Sleep(100); this.Collector.Coords = collector.Coords; for (int x = 0; x < grid.GetLength(0); x++) diff --git a/Trunk/MonoGameView/Game1.cs b/Trunk/MonoGameView/Game1.cs index acda59b..f4bed77 100644 --- a/Trunk/MonoGameView/Game1.cs +++ b/Trunk/MonoGameView/Game1.cs @@ -33,7 +33,7 @@ namespace CzokoŚmieciarka.MonoGameView MapLoader mapLoader = new MapLoader(); Vector2 roadPos; float timer; - const float TIMER = 0.1f; + const float TIMER = 0.001f; int stepN; List steps; GarbageCollector collector; @@ -93,7 +93,7 @@ namespace CzokoŚmieciarka.MonoGameView stepN = 0; - var dfs = new DFS(collector,grid); + var dfs = new BFS(collector,grid); //steps = dfs.BestPath(Content, collector, grid); new Thread(delegate() { var x = dfs.BestPath(Content, collector, grid);