Beispiel #1
0
 public void PassRoute(Route route)
 {
     foreach (var action in serializer.Serialize(route)) {
         server.Invoke(() => Send(action));
         server.Invoke(CheckAnswerIsOk);
     }
     Db.RoutePassed(route);
 }
Beispiel #2
0
        public static void FillDbWithFakeRoute()
        {
            var route = new Route {Scale = 10};

            var points = new List<Point> {
                new Point(0, 2),
                new Point(1, 3),
                new Point(4, 3),
                new Point(4, 6),
                new Point(2, 8),
                new Point(0, 8),
                new Point(0, 10)
            };

            Context.Routes.Add(route);
            Context.Starts.Add(new Start {Position = new Point(0, 0), Offset = new Point(1, 1)});

            for (var i = 0; i < points.Count; i++) {
                Context.Points.Add(points[i]);
                Context.PointRoutes.Add(new PointRoutes {Index = i, Point = points[i], Route = route});
            }

            Context.SaveChanges();
        }
Beispiel #3
0
 public static void RoutePassed(Route route)
 {
     Invoke(() => Context.Log.Add(new Log {Route = route, Time = DateTime.Now, Succeed = true}));
     Invoke(() => Context.SaveChanges());
 }