private void LoadPieton(Pieton p) { Coordinate newCoord = _Environnement.ConvertSimToReal(p.Position); Ellipse ellipse = p.Draw; Canvas.SetLeft(ellipse, newCoord.X); Canvas.SetTop(ellipse, newCoord.Y); SimulationCanvas.Children.Add(ellipse); }
private double CheckWall(Pieton p) { foreach (Wall w in walls) { double di = w.WallCheck(p); if (di != p.Direction) { return(di); } } return(p.Direction); }
private bool CheckPieton(Pieton p) { foreach (Absorbeur a in absorbeurs) { if (a.TouchPieton(p.Position)) { foreach (var child in SimulationCanvas.Children) { if (child == p.Draw) { return(false); } } } } return(true); }
private bool ChekcIfPietonInStep(Pieton piet) { foreach (Pieton p in pietons) { if (p == piet) { continue; } Coordinate newPos = piet.ComputeNewPosition(piet.Position); if (Coordinate.Distance(newPos, p.Position) >= CNST.Radius) { continue; } piet.IsWaiting = true; return(true); //there is a pieton in step } piet.IsWaiting = false; return(false); //Clear }
public PietonWidget(int x, int y, int width, int height, float v, float vmax) { this.Pieton = new Pieton(x, y, width, height, 15, 30); }
public PietonWidget(Rectangle rectangle, float v, float vmax) { this.Pieton = new Pieton(rectangle, v, vmax); }
public void TestCreatePieton() { Pieton pieton1 = new Pieton(30, 30, 10, 10, 0.0f, 150.0f); Assert.IsNotNull(pieton1); }