public void createPigeon() { i++; Pigeon p1 = new Pigeon("p" + i); listp.Add(p1); while (true) { Thread.Sleep(App.env.vitesse); p1.Avance1Tour(p1.X, p1.Y); } }
private static Nourriture closest(Pigeon p1, List <Nourriture> listn) { Nourriture closest = null; double minDist2 = double.MaxValue; foreach (Nourriture n in listn) { double dist2 = Distance2(p1, n); if (dist2 < minDist2) { minDist2 = dist2; closest = n; } } return(closest); }
public void remove(Pigeon p) { listp.Remove(p); }
public void add(Pigeon p) { listp.Add(p); }
public abstract void Deplacement(int dimX, int dimY, Pigeon unPerso);
private static double Distance2Human(Pigeon p1, Human n2) { return(Pow2(n2.X - p1.X) + Pow2(n2.Y - p1.Y)); }
private static double Distance2(Pigeon p1, Nourriture n2) { return(Pow2(n2.X - p1.X) + Pow2(n2.Y - p1.Y)); }