From 4aa62c1f782738207c456249cee4d0ba380a9772 Mon Sep 17 00:00:00 2001 From: ryuga4 Date: Mon, 13 May 2019 13:40:52 +0200 Subject: [PATCH] nie wiem co --- Trunk/MonoGameView/Algorithms/DFS.cs | 9 ++++++--- Trunk/MonoGameView/Game1.cs | 12 ++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Trunk/MonoGameView/Algorithms/DFS.cs b/Trunk/MonoGameView/Algorithms/DFS.cs index 26ba707..b088ba9 100644 --- a/Trunk/MonoGameView/Algorithms/DFS.cs +++ b/Trunk/MonoGameView/Algorithms/DFS.cs @@ -11,6 +11,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework.Content; using System.Threading; +using MonoGameView.DataModels.Models; namespace CzokoŚmieciarka.MonoGameView.Algorithms { @@ -126,16 +127,18 @@ namespace CzokoŚmieciarka.MonoGameView.Algorithms KeyValuePair, int> Search(ContentManager content, GarbageCollector collector, ICloneable[,] grid, int length) { - //Thread.Sleep(100); - /*this.Collector.Coords = collector.Coords; + Thread.Sleep(100); + this.Collector.Coords = collector.Coords; + for (int x = 0; x < grid.GetLength(0); x++) { for (int y = 0; y < grid.GetLength(1); y++) { + this.Grid[x, y] = grid[x, y]; } } - */ + Console.WriteLine(collector.HouseCounter); if (collector.Counter> 100 || length > 100) diff --git a/Trunk/MonoGameView/Game1.cs b/Trunk/MonoGameView/Game1.cs index feffbba..1bdb2d2 100644 --- a/Trunk/MonoGameView/Game1.cs +++ b/Trunk/MonoGameView/Game1.cs @@ -90,11 +90,11 @@ namespace CzokoŚmieciarka.MonoGameView stepN = 0; var dfs = new DFS(collector,grid); - steps = dfs.BestPath(Content, collector, grid); - //new Thread(delegate() { - // var x = dfs.BestPath(Content, collector, grid); + //steps = dfs.BestPath(Content, collector, grid); + new Thread(delegate() { + var x = dfs.BestPath(Content, collector, grid); - //}).Start(); + }).Start(); base.Initialize(); } @@ -130,7 +130,7 @@ namespace CzokoŚmieciarka.MonoGameView { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); - + /* var elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds; timer -= elapsed; if (timer<0) @@ -142,7 +142,7 @@ namespace CzokoŚmieciarka.MonoGameView steps.RemoveAt(0); } } - + */ // TODO: Add your update logic here base.Update(gameTime);