예제 #1
0
        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);
        }
예제 #2
0
 private double CheckWall(Pieton p)
 {
     foreach (Wall w in walls)
     {
         double di = w.WallCheck(p);
         if (di != p.Direction)
         {
             return(di);
         }
     }
     return(p.Direction);
 }
예제 #3
0
 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);
 }
예제 #4
0
 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
 }
예제 #5
0
 public PietonWidget(int x, int y, int width, int height, float v, float vmax)
 {
     this.Pieton = new Pieton(x, y, width, height, 15, 30);
 }
예제 #6
0
 public PietonWidget(Rectangle rectangle, float v, float vmax)
 {
     this.Pieton = new Pieton(rectangle, v, vmax);
 }
예제 #7
0
        public void TestCreatePieton()
        {
            Pieton pieton1 = new Pieton(30, 30, 10, 10, 0.0f, 150.0f);

            Assert.IsNotNull(pieton1);
        }