public void Tracer_chemin(Vector2 position) { _position = position; if (_trajet._count == 0 && position != _posPerso) { _trajet.AddChemin(position); _trajet.AddChemin(position); _path = new PathFinding(_trajet, _zone); } else if (_trajet._count > 0) { _trajet.AddChemin(position); _path = new PathFinding(_trajet, _zone); } }
public void ApplyPath(List <System.Drawing.Point> path) { Console.WriteLine(path.Count); if (path.Count > 0 && path.Count < _trajet._count - 1) { _trajet._vide = true; _trajet._trajet.Clear(); _trajet.AddChemin(new Vector2(path[0].X * _ecart._x + _mapPosStart, path[0].Y * _ecart._y)); foreach (System.Drawing.Point curr in path) { _trajet.AddChemin(new Vector2(curr.X * _ecart._x + _mapPosStart, curr.Y * _ecart._y)); } } else if (path.Count == 0) { _trajet.Clear(); } }