szybciej
This commit is contained in:
parent
a70153a4d3
commit
e7e3658c97
@ -142,14 +142,14 @@ namespace MonoGameView.Algorithms
|
|||||||
foreach (var item in nodes)
|
foreach (var item in nodes)
|
||||||
{
|
{
|
||||||
// Thread.Sleep(100);
|
// 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 x = 0; x < item.Item3.GetLength(0); x++)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < item.Item3.GetLength(1); y++)
|
for (int y = 0; y < item.Item3.GetLength(1); y++)
|
||||||
{
|
{
|
||||||
this.Grid[x, y] = item.Item3[x, 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))
|
if (Houses.All(c => (item.Item3[c.X, c.Y] as IGarbageLocalization).TrashCans.All(j => j.FillPercent == 0.0))
|
||||||
&&
|
&&
|
||||||
|
@ -127,7 +127,7 @@ namespace CzokoŚmieciarka.MonoGameView.Algorithms
|
|||||||
KeyValuePair<List<IStep>, int> Search(ContentManager content, GarbageCollector collector, ICloneable[,] grid, int length)
|
KeyValuePair<List<IStep>, int> Search(ContentManager content, GarbageCollector collector, ICloneable[,] grid, int length)
|
||||||
{
|
{
|
||||||
|
|
||||||
Thread.Sleep(100);
|
//Thread.Sleep(100);
|
||||||
this.Collector.Coords = collector.Coords;
|
this.Collector.Coords = collector.Coords;
|
||||||
|
|
||||||
for (int x = 0; x < grid.GetLength(0); x++)
|
for (int x = 0; x < grid.GetLength(0); x++)
|
||||||
|
@ -33,7 +33,7 @@ namespace CzokoŚmieciarka.MonoGameView
|
|||||||
MapLoader mapLoader = new MapLoader();
|
MapLoader mapLoader = new MapLoader();
|
||||||
Vector2 roadPos;
|
Vector2 roadPos;
|
||||||
float timer;
|
float timer;
|
||||||
const float TIMER = 0.1f;
|
const float TIMER = 0.001f;
|
||||||
int stepN;
|
int stepN;
|
||||||
List<IStep> steps;
|
List<IStep> steps;
|
||||||
GarbageCollector collector;
|
GarbageCollector collector;
|
||||||
@ -93,7 +93,7 @@ namespace CzokoŚmieciarka.MonoGameView
|
|||||||
|
|
||||||
|
|
||||||
stepN = 0;
|
stepN = 0;
|
||||||
var dfs = new DFS(collector,grid);
|
var dfs = new BFS(collector,grid);
|
||||||
//steps = dfs.BestPath(Content, collector, grid);
|
//steps = dfs.BestPath(Content, collector, grid);
|
||||||
new Thread(delegate() {
|
new Thread(delegate() {
|
||||||
var x = dfs.BestPath(Content, collector, grid);
|
var x = dfs.BestPath(Content, collector, grid);
|
||||||
|
Loading…
Reference in New Issue
Block a user