public PathBuilder() { map = new int[0, 0]; path = new AIpath(); startPoint = new Vector2(0); endPoint = new Vector2(0); doneBuilding = false; }
public void HighlightPath(AIpath path) { Vector2 v; for (int i = 0; i < path.LENGTH; i++) { v = path.GetCoordinate(i); map[(int)v.X, (int)v.Y].UpDateColor(Color.CornflowerBlue); } }
public PathBuilder(int[,] map, Vector2 start, Vector2 end) { path = new AIpath(); this.map = map; startPoint = start; endPoint = end; doneBuilding = false; mapDemendions.X = map.GetLength(0); mapDemendions.Y = map.GetLength(1); }
public void BuildPath() { path = new AIpath(); currentPoint = endPoint; path.AddCoordinates(currentPoint); while (!doneBuilding) { Vector2 nextPoint = FindNextCoordinate(); if (nextPoint == startPoint) { path.AddCoordinates(nextPoint); doneBuilding = true; } else { path.AddCoordinates(nextPoint); currentPoint = nextPoint; } } doneBuilding = false; }
public PathBuilder(Vector2[] pathCoordinates) { path = new AIpath(pathCoordinates); doneBuilding = true; }