forked from s425077/PotatoPlan
35 lines
773 B
C#
35 lines
773 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Microsoft.Xna.Framework;
|
|||
|
|
|||
|
class Astar
|
|||
|
{
|
|||
|
|
|||
|
private Vector2 tractorPos;
|
|||
|
private Vector2 housePos;
|
|||
|
private Crops[,] crops;
|
|||
|
private Vector2 Size;
|
|||
|
private PriorityQueue allPaths;
|
|||
|
|
|||
|
public void update(Crops[,] newCrops, Vector2 newSize, Vector2 newTractorPos, Vector2 newHousePos)
|
|||
|
{
|
|||
|
tractorPos = new Vector2((int)newTractorPos.X, (int)newTractorPos.Y);
|
|||
|
housePos = new Vector2((int)newHousePos.X, (int)newHousePos.Y);
|
|||
|
crops = newCrops;
|
|||
|
Size = newSize;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public void findPath()
|
|||
|
{
|
|||
|
int i = 1;
|
|||
|
}
|
|||
|
|
|||
|
public Path getOptimalPath()
|
|||
|
{
|
|||
|
return allPaths.Peek();
|
|||
|
}
|
|||
|
}
|