Exemplo n.º 1
0
        private void Close_Click(object sender, RoutedEventArgs e)
        {
            // Close application
            Close();

            // Unhook event handlers from each object
            Cameras.ForEach(p => p.UnHookEvents());
            OpenLightFields.ForEach(p => p.UnHookEvents());
        }
Exemplo n.º 2
0
        public Car(Configuration.Car car, List <Configuration.Track> tracks)
        {
            Id              = Guid.NewGuid();
            Name            = car.Name;
            Direction       = Direction.Up;
            Cameras         = car.Cameras.Select(c => new Camera(c)).ToList();
            MaxAcceleration = car.Acceleration;
            Track           = new Models.Vehicles.Track(tracks.Single(t =>
                                                                      t.CarName.Equals(car.Name, StringComparison.OrdinalIgnoreCase)));
            Position     = Track.StartPoint;
            CurrentSpeed = 14; //m/s
            InUse        = true;
            Size         = new Vector2(10, 30);
            Collider     = new BoxCollider(Position, Size);

            Cameras.ForEach(c => c.Position = this.Position);
        }
Exemplo n.º 3
0
 public void SetDirection(Direction direction)
 {
     Direction = direction;
     Cameras.ForEach(c => c.SetDirectionByCarDirection(direction));
 }