コード例 #1
0
ファイル: Car.cs プロジェクト: justinsaraceno/SampleLibrary
        public override void StopVehicle(IVehicle car)
        {
            switch (car.RadioState)
            {
                case RadioState.AM:
                case RadioState.FM:
                case RadioState.XM:
                case RadioState.CD:
                case RadioState.Off:
                    {
                        car.RadioState = RadioState.Off;
                        break;
                    }
                default:
                    {
                        car.RadioState = RadioState.Auxilary;
                        break;
                    }
            }

            car.MessageLog.Add("The car radio state was set.");

            if (car.FuelType == FuelType.JetFuel)
            {
                this.RunEngineCoolingProcess(car);
            }

            base.StopVehicle(car);
        }
コード例 #2
0
        public void StartParking(IVehicle vehicle)
        {
            Parking parking;
            if (_startTimes == null) //normal operation
            {
                parking = new Parking
                {
                    Vehicle = vehicle,
                    StartTime = DateTime.Now,
                    EndTime = default(DateTime)
                };
            }
            else //set startTime manually for testing
            {
                parking = new Parking
                {
                    Vehicle = vehicle,
                    StartTime = _startTimes[0],
                    EndTime = default(DateTime)
                };
                _startTimes.RemoveAt(0);
            }

            _currentParkings.Add(parking);
        }
コード例 #3
0
ファイル: Ticket.cs プロジェクト: peterkirilov/SoftUni-1
 public Ticket(IVehicle vehicle, decimal payedMoney, string parkedPlace, int endTime)
 {
     this.Vehicle = vehicle;
     this.PayedMoney = payedMoney;
     this.ParkedPlace = parkedPlace;
     this.EndTime = endTime;
 }
コード例 #4
0
        private StringBuilder PrintTicket(decimal paidMoney, IVehicle vehicle, int parkingHours, int sector, int place)
        {
            var totalDueSum = (vehicle.ReservedHours * vehicle.RegularRate) +
                (parkingHours > vehicle.ReservedHours ?
                (parkingHours - vehicle.ReservedHours) *
                vehicle.OvertimeRate : 0);
            var change = paidMoney -
                         ((vehicle.ReservedHours * vehicle.RegularRate) +
                          (parkingHours > vehicle.ReservedHours
                              ? (parkingHours - vehicle.ReservedHours) * vehicle.OvertimeRate
                              : 0));
            var overtimeRtae = parkingHours > vehicle.ReservedHours
                ? (parkingHours - vehicle.ReservedHours) * vehicle.OvertimeRate
                : 0;

            var ticket = new StringBuilder();
            ticket.AppendLine(new string('*', 20))
                .AppendFormat("{0}", vehicle.ToString()).AppendLine()
                .AppendFormat("at place ({0},{1})", sector, place).AppendLine()
                .AppendFormat("Rate: ${0:F2}", vehicle.ReservedHours * vehicle.RegularRate).AppendLine()
                .AppendFormat("Overtime rate: ${0:F2}", overtimeRtae).AppendLine()
                .AppendLine(
                new string('-', 20))
                .AppendFormat("Total: ${0:F2}", totalDueSum).AppendLine()
                .AppendFormat("Paid: ${0:F2}", paidMoney).AppendLine().AppendFormat(
                "Change: ${0:F2}", change).AppendLine().Append(new string('*', 20));
            return ticket;
        }
コード例 #5
0
        public VehicleTireReading(IVehicle CurrentVehicle)
        {
            Id = Guid.NewGuid();
            CurrentTires = CurrentVehicle.Tires;
            ReadingTimeStamp = DateTime.UtcNow;
            CurrrentDistanceTraveled = CurrentVehicle.OdometerInMiles;
            ReadingId = createReadingHashKey(ReadingTimeStamp, CurrentVehicle.Id);
            VehicleId = CurrentVehicle.Id;
            TypeOfCar = CurrentVehicle.VehicleType;
            Readings = new List<TireReading>();
            int maxSpeed = 0;
            int lastSpeed = 0;

            foreach (CarTire ct in CurrentTires)
            {
                TireReading currentReading = new TireReading(this, ct);
                lastSpeed = ct.GetCurrentSpeed();
                //Capture the last speed
                if (lastSpeed > CurrentSpeed)
                {
                    CurrentSpeed = lastSpeed;
                }
                maxSpeed = ct.MaxSpeedRating;
                Readings.Add(currentReading);
            }
        }
コード例 #6
0
        // XXX 4-23-03: Temporary work around (see comment above)
        //
        // Checks for intersection of the given spherical obstacle with a
        // volume of "likely future vehicle positions": a cylinder along the
        // current path, extending minTimeToCollision seconds along the
        // forward axis from current position.
        //
        // If they intersect, a collision is imminent and this function returns
        // a steering force pointing laterally away from the obstacle's center.
        //
        // Returns a zero vector if the obstacle is outside the cylinder
        //
        // xxx couldn't this be made more compact using localizePosition?
        public Vector3 SteerToAvoid(IVehicle v, float minTimeToCollision)
        {
            // minimum distance to obstacle before avoidance is required
            float minDistanceToCollision = minTimeToCollision * v.Speed;
            float minDistanceToCenter = minDistanceToCollision + Radius;

            // contact distance: sum of radii of obstacle and vehicle
            float totalRadius = Radius + v.Radius;

            // obstacle center relative to vehicle position
            Vector3 localOffset = Center - v.Position;

            // distance along vehicle's forward axis to obstacle's center
            float forwardComponent = Vector3.Dot(localOffset, v.Forward);
            Vector3 forwardOffset = v.Forward * forwardComponent;

            // offset from forward axis to obstacle's center
            Vector3 offForwardOffset = localOffset - forwardOffset;

            // test to see if sphere overlaps with obstacle-free corridor
            bool inCylinder = offForwardOffset.Length() < totalRadius;
            bool nearby = forwardComponent < minDistanceToCenter;
            bool inFront = forwardComponent > 0;

            // if all three conditions are met, steer away from sphere center
            if (inCylinder && nearby && inFront)
            {
                return offForwardOffset * -1;
            }
            else
            {
                return Vector3.Zero;
            }
        }
コード例 #7
0
        public void StartParking(IVehicle vehicle)
        {
            int numberOfOccupiedParkingSpots = _parkingService.GetNumberOfCurrentParkings();

            //check vehicle measurements
            if (vehicle.LengthInMeters > ParkingSpotLengthInMeters || vehicle.WidthInMeters > ParkingSpotWidthInMeters)
            {
                throw new VehicleSizeException("This vehicle is too large to fit in a parking spot");
            }

            if (numberOfOccupiedParkingSpots == NumberOfParkingSpots)
            {
                //this could happen if the last empty 10% of parking spots are taken by customers with contracts and noone stops parking at that time
                throw new ParkingException("Parking garage is full");
            }

            //check contract
            if (_parkingService.HasParkingContract(vehicle))
            {
                _parkingService.StartParking(vehicle);
            }
            else // no contract
            {
                //check that at least 10% of parking spots are reserved for customers with contracts before allowing to park

                if (numberOfOccupiedParkingSpots < NumberOfParkingSpots - RequiredFreeParkingSpots)
                {
                    _parkingService.StartParking(vehicle);
                }
                else
                {
                    throw new ParkingException("Remaining free parking spots reserved for customers with contracts");
                }
            }
        }
コード例 #8
0
 public SimpleTrainMovingStrategy(IVehicle vehicle)
 {
     _time = 0;
     _vehicle = vehicle;
     _timer = new Timer { Interval = _interval };
     _timer.Elapsed += (sender, args) => { _time++; };
 }
コード例 #9
0
 public VehicleManager()
 {
     _saloon = new Saloon(new StandardEngine(1200));
     _coupe = new Coupe(new StandardEngine(1200));
     _sport = new Sport(new StandardEngine(1200));
     _boxVan = new BoxVan(new StandardEngine(1200));
     _pickup = new Pickup(new StandardEngine(1200));
 }
コード例 #10
0
ファイル: LuxuryCar.cs プロジェクト: rajthapa2/solid
 public LuxuryCar(IVehicle vehicleControls,
             IAudioControl audioControls,
             IOperateSunRoof sunRoofControls)
 {
     _vehicleControls = vehicleControls;
     _audioControls = audioControls;
     _sunRoofControls = sunRoofControls;
 }
コード例 #11
0
ファイル: ParkingSpace.cs プロジェクト: Farga83/Algs4
 protected string Park(IVehicle car)
 {
     if (this.Occupied) {
         throw new ApplicationException("Can't park a car in a full space");
     }
     this.ParkedCar = car;
     return this.Id;
 }
コード例 #12
0
 public virtual IVehicle CreateSaloon()
 {
     if (saloon == null)
     {
         saloon = new Saloon(new StandardEngine(1300));
     }
     return (IVehicle)saloon.Clone();
 }
コード例 #13
0
 public virtual void StopVehicle(IVehicle vehicle)
 {
     if (vehicle.EngineState == EngineState.Started)
     {
         vehicle.EngineState = EngineState.Stopped;
         vehicle.MessageLog.Add("Stopped the vehicle.");
     }
 }
コード例 #14
0
ファイル: Household.cs プロジェクト: Cocotus/XTMF
 public Household(int id, ITashaPerson[] persons, IVehicle[] vehicles, float expansion, IZone zone)
 {
     //this.auxiliaryTripChains = new List<ITripChain>(7);
     HouseholdId = id;
     Persons = persons;
     Vehicles = vehicles;
     ExpansionFactor = expansion;
     HomeZone = zone;
 }
コード例 #15
0
        public string GetParkedSpot(IVehicle vehicle)
        {
            if (!this.parkedCarsInSectroAndPlace.ContainsKey(vehicle))
            {
                throw new InvalidOperationException("No such vehicle");
            }

            return this.parkedCarsInSectroAndPlace[vehicle];
        }
コード例 #16
0
        public DateTime GetExpectedTimeForVehicle(IVehicle vehicle)
        {
            if (!this.expectedTimePerVehicle.ContainsKey(vehicle))
            {
                throw new InvalidOperationException("No such vehicle");
            }

            return this.expectedTimePerVehicle[vehicle];
        }
コード例 #17
0
 public void AddVehicle(IVehicle vehicle, int sector, int placeNumber, DateTime startTime)
 {
     LocationByVehicle[vehicle] = string.Format("({0},{1})", sector, placeNumber);
     VehicleByLocation[string.Format("({0},{1})", sector, placeNumber)] = vehicle;
     VehicleByLicensePlate[vehicle.LicensePlate] = vehicle;
     VehicleByStartTime[vehicle] = startTime;
     VehcileByOwner[vehicle.Owner].Add(vehicle);
     sectors[sector - 1]++;
 }
コード例 #18
0
 public VehicleManager()
 {
     // For simplicity all vehicles use same engine type...
     saloon = new Saloon(new StandardEngine(1300));
     coupe = new Coupe(new StandardEngine(1300));
     sport = new Sport(new StandardEngine(1300));
     boxVan = new BoxVan(new StandardEngine(1300));
     pickup = new Pickup(new StandardEngine(1300));
 }
コード例 #19
0
ファイル: Data.cs プロジェクト: ikolev94/Exercises
 public void InsertVehicleInDatabase(IVehicle vehicle, int sector, DateTime startTime, string place)
 {
     this.VehiclesInParkPlaces[vehicle] = place;
     this.ParkPlaces[place] = vehicle;
     this.VehiclesByLicensePlate[vehicle.LicensePlate] = vehicle;
     this.VehiclesByStartTime[vehicle] = startTime;
     this.VehiclesByOwner[vehicle.Owner].Add(vehicle);
     this.SpacesCount[sector - 1]++;
 }
コード例 #20
0
ファイル: Car.cs プロジェクト: justinsaraceno/SampleLibrary
        public override void StartVehicle(IVehicle car)
        {
            if (car.FuelType == FuelType.Diesel)
            {
                base.WarmGlowplugs(car);
            }

            base.StartVehicle(car);
        }
コード例 #21
0
        public void AddVehicle(IVehicle vehicle, int sector, int place, DateTime entryTime)
        {
            this.PositionByVehicle[vehicle] = string.Format("({0},{1})", sector, place);

            this.VehicleByPosition[string.Format("({0},{1})", sector, place)] = vehicle;
            this.VehiclesByLicensePlate[vehicle.LicensePlate] = vehicle;
            this.EntryTimesByVehicles[vehicle] = entryTime;
            this.VehiclesByOwner[vehicle.Owner].Add(vehicle);
            this.VehiclesInSector[sector - 1]++;
        }
コード例 #22
0
ファイル: Data.cs プロジェクト: ikolev94/Exercises
 public void RemoveVehicleFromDatabase(IVehicle vehicle)
 {
     int sector = int.Parse(this.VehiclesInParkPlaces[vehicle].Split(new[] { "(", ",", ")" }, StringSplitOptions.RemoveEmptyEntries)[0]);
     this.ParkPlaces.Remove(this.VehiclesInParkPlaces[vehicle]);
     this.VehiclesInParkPlaces.Remove(vehicle);
     this.VehiclesByLicensePlate.Remove(vehicle.LicensePlate);
     this.VehiclesByStartTime.Remove(vehicle);
     this.VehiclesByOwner.Remove(vehicle.Owner, vehicle);
     this.SpacesCount[sector - 1]--;
 }
コード例 #23
0
        // (parameter names commented out to prevent compiler warning from "-W")
        public void AnnotateAvoidNeighbor(IVehicle threat, float steer, Vector3 ourFuture, Vector3 threatFuture)
        {
            Color green = new Color((byte)(255.0f * 0.15f), (byte)(255.0f * 0.6f), 0);

            annotation.Line(Position, ourFuture, green);
            annotation.Line(threat.Position, threatFuture, green);
            annotation.Line(ourFuture, threatFuture, Color.Red);
            annotation.CircleXZ(Radius, ourFuture, green, 12);
            annotation.CircleXZ(Radius, threatFuture, green, 12);
        }
コード例 #24
0
 public SingleVehicle(IVehicle vehicle)
 {
     _vehicle = vehicle;
     _trafficLight = new TrafficLight(StopVehicle);
     List<MenuItem> singleVehicleMenuItems = new List<MenuItem>();
     singleVehicleMenuItems.Add(new MenuItem(1, "Increase Vehicle Speed.", new CommonDel(IncreaseVehicleSpeed)));
     singleVehicleMenuItems.Add(new MenuItem(2, "Keep Vehicle Current Speed.", new CommonDel(KeepVehicleCurrentSpeed)));
     singleVehicleMenuItems.Add(new MenuItem(3, "Decrease Vehicle Speed.", new CommonDel(DecreaseVehicleSpeed)));
     singleVehicleMenu = new MenuCls("Vehicle Menu", singleVehicleMenuItems);
 }
コード例 #25
0
		/// <summary>
		///   Initializes a new instance.
		/// </summary>
		public VehicleCollection(IVehicle vehicle1, IVehicle vehicle2, IVehicle vehicle3)
		{
			_vehicle1 = vehicle1;
			_vehicle2 = vehicle2;
			_vehicle3 = vehicle3;

			Bind(_vehicle1.RequiredPorts.IsTunnelClosed = ProvidedPorts.CheckIsTunnelClosed);
			Bind(_vehicle2.RequiredPorts.IsTunnelClosed = ProvidedPorts.CheckIsTunnelClosed);
			Bind(_vehicle3.RequiredPorts.IsTunnelClosed = ProvidedPorts.CheckIsTunnelClosed);
		}
コード例 #26
0
ファイル: SimpleSeeking.cs プロジェクト: RobbSteel/MMM
 void OnTriggerEnter(Collider other)
 {
     //Debug.Log ("Hi");
     if(changedTargets) return;
     if(other.gameObject.tag == "Decoy"){
         DecoyMissile decoy = other.gameObject.GetComponent<DecoyMissile>();
         decoy.follow_count += 1;
         target = decoy;
     }
 }
コード例 #27
0
 public void RemoveVehicleFromData(IVehicle vehicle)
 {
     VehicleByLocation.Remove(LocationByVehicle[vehicle]);
     VehicleByLicensePlate.Remove(vehicle.LicensePlate);
     VehicleByStartTime.Remove(vehicle);
     VehcileByOwner[vehicle.Owner].Remove(vehicle);
     int sector = int.Parse(this.LocationByVehicle[vehicle].Split(new[] { "(", ",", ")" }, StringSplitOptions.RemoveEmptyEntries)[0]); ;
     LocationByVehicle.Remove(vehicle);
     sectors[sector - 1]--;
 }
コード例 #28
0
        public virtual void PrepareForSale(IVehicle vehicle)
        {
            var reg = new Registration(vehicle);
            reg.AllocateLicensePlate();
            Documentation.PrintBrochure(vehicle);

            vehicle.CleanInterior();
            vehicle.ClearExteriorBody();
            vehicle.PolishWindows();
            vehicle.TakeForTestDrive();
        }
コード例 #29
0
ファイル: Missile.cs プロジェクト: cupsster/SharpSteer2
 public Missile(IProximityDatabase<IVehicle> proximity, IVehicle target, IAnnotationService annotation)
     :base(annotation)
 {
     _trail = new Trail(1, 10)
     {
         TrailColor = Color.Red,
         TickColor = Color.DarkRed
     };
     _proximityToken = proximity.AllocateToken(this);
     Target = target;
 }
コード例 #30
0
 protected internal void WarmGlowplugs(IVehicle vehicle)
 {
     if (vehicle.FuelType == FuelType.Diesel)
     {
         vehicle.MessageLog.Add("Warming glow-plugs.");
     }
     else
     {
         throw new NotSupportedException("Can not warm glow-plugs unless the vehicle has a diesel engine.");
     }
 }
コード例 #31
0
ファイル: IVehicle.cs プロジェクト: bozoweed/coreclr-module
 /// <summary>
 /// Gets the current number plate style
 /// </summary>
 /// <param name="vehicle">The vehicle</param>
 /// <returns>The number plate style</returns>
 public static NumberPlateStyle GetNumberPlateStyle(this IVehicle vehicle) =>
 (NumberPlateStyle)vehicle.NumberplateIndex;
コード例 #32
0
 public VehicleDecorator(IVehicle vehicle)
 {
     _vehicle = vehicle;
 }
コード例 #33
0
 public void Release(IVehicle vehicle)
 {
     FeeFactory.Release(vehicle.Fees);
     VehicleFactory.Release(vehicle);
 }
コード例 #34
0
ファイル: Program.cs プロジェクト: justin-hubbard/Capstone
        static void Main()
        {
            //change the test file xml here and make sure it is in bin.
            string startingXMLFile = "ETRL_03_07.xml";
            //string startingXMLFile = "FloorPlanTest.xml";
            //string startingOpenFile = "Sloan46_FINAL.xml";
            double compassToMapOffset = 72.0;

            // List of all the objects we'll be initializing.
            // Default to null, as some of them will only
            // be initialized conditionally e.g.
            // vehicle is only initialized if
            // there is a vehicle connected.
            SerialPort        sp               = null;
            IVehicle          vehicle          = null;
            IImageStream      depthStream      = null;
            IImageStream      videoStream      = null;
            IObstacleDetector obstacleDetector = null;
            ICartographer     cartographer     = null;
            IOdometer         odometer         = null;
            IInputDevice      input            = KeyboardInput.Instance;
            ObstacleMap       obstacleMap      = null;
            INavigator        navigator        = null;
            MainWindow        mainWindow       = null;

            Driver.Driver            driver           = null;
            VisualInputGridPresenter uiInputPresenter = null;
            ObstacleGridPresenter    uiGridPresenter  = null;
            PositioningSystem        ips             = null;
            OverlayRenderer          overlayRenderer = null;
            SensorArray       sensorArray            = null;
            Pose              pose              = null;
            IDoorDetector     doorDetector      = null;
            ObstacleLocalizer obstacleLocalizer = null;
            SonarDetector     sonarDetector     = null;

            Config.Initialize();

            Devices.Initialize();
            //string wheelchair_com_port = Devices.IsWheelchairConnected();
            string wheelchair_com_port = "COM3";//Devices.FindComPort("Arduino Uno");
            bool   WheelChairConnected = false;

            if (wheelchair_com_port != "")
            {
                WheelChairConnected = true;
            }
            //bool WheelChairConnected = true;
            bool EyeTribeConnected   = true; // Devices.IsEyeTribeConnected();
            bool ControllerConnected = true; //Devices.IsControllerConnected();
            bool KinectConnected     = true; //Devices.IsKinectConnected();

            //Console.WriteLine("Kinect Connected: {0}", KinectConnected.ToString());
            //Console.WriteLine("Eyetribe Connected: {0}", EyeTribeConnected.ToString());
            //Console.WriteLine("Wheelchair Connected: {0}", WheelChairConnected.ToString());
            //Console.WriteLine("Controller Connected: {0}", ControllerConnected.ToString());

            // Initialize vehicle and serial connection if
            // there is a vehicle connected.

            if (WheelChairConnected)
            {
                //sp = new SerialPort(wheelchair_com_port, 9600);
                vehicle = Wheelchair.Instance(wheelchair_com_port);
                vehicle.initializeOffset(Properties.Settings.Default.CalibrationOffset);
            }
            else
            {
                vehicle = new MockVehicle();

                MockVehicleWindow mockDisplay = new MockVehicleWindow((MockVehicle)vehicle);
                mockDisplay.Show();
            }

            //initalize IPS here

            IByteReader sensorReader = null;

            try
            {
                //sensorReader = new SerialByteReader("Arduino Mega");
                sensorReader = new SerialByteReader("COM4");
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            if (sensorReader != null)
            {
                ILogger logger = new NullLogger();
                sensorArray   = new SensorArray(sensorReader, logger);
                sonarDetector = new SonarDetector();
            }
            else
            {
                sensorReader = new NullByteReader();

                ILogger logger = new NullLogger();
                sensorArray = new SensorArray(sensorReader, logger);
            }

            IByteReader byteReader = null;

            try
            {
                //byteReader = new SerialByteReader(Devices.FindComPort("STMicroelectronics"));
                byteReader = new SerialByteReader("COM3");
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            if (byteReader != null)
            {
                ILogger logger = new NullLogger();
                ips = new MarvelMind(byteReader, logger);
            }
            else
            {
                //Setup Mock IPS

                //IByteReader mockByteReader = new FileByteReader(@"C:\Users\Dana\Documents\Visual Studio 2013\Projects\UITests\UITests\Mock_IPS_Data.txt");
                //IByteReader mockByteReader = new XLineFixedYByteReader(800, 100, 200);
                IByteReader mockByteReader = new RandomByteReader(300, 299);
                ILogger     mockLogger     = new NullLogger();
                ips = new MarvelMind(mockByteReader, mockLogger);
            }

            //wait for an iteration of the IPS system that way
            //we can get the starting location
            while (false == ips.XUpdated && false == ips.YUpdated)
            {
                continue;
            }

            //Tuple<double, double> t = new Tuple<double, double>((double)ips.X, (double)ips.Y);
            Tuple <double, double> t    = new Tuple <double, double>((double)ips.Y, (double)ips.X);
            mPoint startingLocationInXY = new mPoint(t);

            // UI, input, object detection, navigation, and driver are initialized always,
            // as they are not directly dependent on external hardware.
            obstacleMap = new ObstacleMap();
            //cartographer = new Cartographer(Directory.GetCurrentDirectory() + @"\FloorPlanTest.xml", ips);

            // might need to be changed later. If the location is not in the starting room. add staring room.
            //cartographer = new Cartographer(Directory.GetCurrentDirectory() + @"\FloorPlanTest.xml", startingLocationInXY);

            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "XML | *.xml";
            ofd.Title  = "Open Map";
            if (ofd.ShowDialog() == true)
            {
                startingXMLFile = ofd.FileName;
                Console.WriteLine(startingXMLFile);
            }

            cartographer = new Cartographer(startingXMLFile, startingLocationInXY);
            pose         = new Pose(ips, cartographer.GetStartingRoom(), sensorArray.CompassDevice, compassToMapOffset);

            overlayRenderer = new OverlayRenderer();

            if (KinectConnected)
            {
                depthStream = DepthStream.Instance;
                videoStream = VideoStream.Instance;

                // Initialize depthstream if kinect is connected.
                obstacleDetector = new ObstacleDetector(depthStream, false);
                obstacleDetector.Start();

                obstacleLocalizer = new ObstacleLocalizer(pose);

                ObstaclesOverlay obstaclesOverlay = new ObstaclesOverlay(obstacleDetector);
                overlayRenderer.Overlays.Add(obstaclesOverlay);

                doorDetector = new DepthBasedDoorDetector();
                doorDetector.RunAsync(depthStream);

                try
                {
                    sonarDetector.RunAsync(sensorArray);
                }
                catch (Exception e)
                {
                }
            }

            // Obstacle detector and driver are only run
            // if both the vehicle and kinect are connected.
            if (vehicle != null && KinectConnected)
            {
                Vector startPoint    = new Vector(7 / 0.75f, 43 / 0.75f);
                Vector startRotation = new Vector(-7, -43);
                startRotation.Normalize();
                odometer = new Odometer();

                navigator = new Navigator(obstacleMap, obstacleDetector, obstacleLocalizer, cartographer, doorDetector, pose, sonarDetector, sensorArray);
                driver    = new Driver.Driver(input, vehicle, navigator);
                driver.Start();
            }

            mainWindow       = new MainWindow(pose, obstacleMap, cartographer, navigator, doorDetector, overlayRenderer, EyeTribeConnected, ControllerConnected, sensorArray);
            uiInputPresenter = new VisualInputGridPresenter(mainWindow.visualInputGrid);

            //This starts the program.
            Application app = new Application();

            app.ShutdownMode = ShutdownMode.OnMainWindowClose;
            app.MainWindow   = mainWindow;
            app.MainWindow.Show();
            app.Run();
        }
コード例 #35
0
 public void CreateMValueVehicle(out MValueConst mValue, IVehicle value)
 {
     throw new NotImplementedException();
 }
コード例 #36
0
 /// <summary> Creates a new transient object that can be persisted later. </summary>
 /// <param name="dataRepository"> A data repository to persist the object with. </param>
 /// <param name="vehicle"> The vehicle this localisation belongs to. </param>
 /// <param name="localisationRecord"> A collection of localisation values read from CSV files. </param>
 public ResearchTreeName(IDataRepository dataRepository, IVehicle vehicle, IList <string> localisationRecord)
     : base(dataRepository, vehicle, localisationRecord)
 {
 }
コード例 #37
0
        public static bool TryGetVehicle(this DataGridRow row, out IVehicle vehicle)
        {
            var gaijinId = row.GetFieldValue(nameof(IPersistentObjectWithIdAndGaijinId.GaijinId))?.ToString() ?? string.Empty;

            return(ApplicationHelpers.Manager.PlayableVehicles.TryGetValue(gaijinId, out vehicle));
        }
コード例 #38
0
        public void StartTransport()
        {
            IVehicle vehicle = CreateTransport();

            vehicle.StartRoute();
        }
コード例 #39
0
 public ProxyScooter(Driver driver)
 {
     this.driver = driver;
     vehicle     = new Scooter();
 }
コード例 #40
0
 public virtual IVehicle CreateSaloon()
 {
     _Saloon = _Saloon ?? new Saloon(new StandardEngine(_ENGINE_SIZE));
     return((IVehicle)_Saloon.Clone());
 }
コード例 #41
0
ファイル: User.cs プロジェクト: donstany/Telerik-Academy
        public void RemoveVehicle(IVehicle vehicle)
        {
            Validator.ValidateNull(vehicle, Constants.VehicleCannotBeNull);

            this.Vehicles.Remove(vehicle);
        }
コード例 #42
0
ファイル: IVehicle.cs プロジェクト: bozoweed/coreclr-module
 /// <summary>
 /// Sets the current radio station
 /// </summary>
 /// <param name="vehicle">The vehicle</param>
 /// <param name="radioStation">The radio station</param>
 public static void SetRadioStation(this IVehicle vehicle, RadioStation radioStation) =>
 vehicle.RadioStation = (uint)radioStation;
コード例 #43
0
ファイル: IVehicle.cs プロジェクト: bozoweed/coreclr-module
 /// <summary>
 /// Sets the current number plate style
 /// </summary>
 /// <param name="vehicle">The vehicle</param>
 /// <param name="numberPlateStyle">The number plate style</param>
 public static void SetNumberPlateStyle(this IVehicle vehicle, NumberPlateStyle numberPlateStyle) =>
 vehicle.NumberplateIndex = (uint)numberPlateStyle;
コード例 #44
0
ファイル: IVehicle.cs プロジェクト: bozoweed/coreclr-module
 /// <summary>
 /// Sets the current window tint
 /// </summary>
 /// <param name="vehicle">The vehicle</param>
 /// <param name="windowTint">The window tint</param>
 public static void SetWindowTint(this IVehicle vehicle, WindowTint windowTint) =>
 vehicle.WindowTint = (byte)windowTint;
コード例 #45
0
 public AirConditionedVehicle(IVehicle vehicle)
     : base(vehicle)
 {
 }
コード例 #46
0
 public virtual IVehicle CreateBoxVan()
 {
     _BoxVan = _BoxVan ?? new BoxVan(new StandardEngine(_ENGINE_SIZE));
     return((IVehicle)_BoxVan.Clone());
 }
コード例 #47
0
 public Order(IVehicle vehicle, ICustomer customer)
 {
     this.vehicle  = vehicle;
     this.customer = customer;
 }
コード例 #48
0
 public PlayerEnterVehicleEvent(IPlayer player, IVehicle vehicle) : base(player)
 {
     Vehicle = vehicle;
 }
コード例 #49
0
 public void AddComment(IComment commentToAdd, IVehicle vehicleToAddComment)
 {
     vehicleToAddComment.Comments.Add(commentToAdd);
 }
コード例 #50
0
ファイル: IVehicle.cs プロジェクト: bozoweed/coreclr-module
 /// <summary>
 /// Gets the current radio station
 /// </summary>
 /// <param name="vehicle">The vehicle</param>
 /// <returns>The radio station</returns>
 public static RadioStation GetRadioStation(this IVehicle vehicle) => (RadioStation)vehicle.RadioStation;
コード例 #51
0
ファイル: IVehicle.cs プロジェクト: bozoweed/coreclr-module
 /// <summary>
 /// Gets the current window tint
 /// </summary>
 /// <param name="vehicle">The vehicle</param>
 /// <returns>The window tint</returns>
 public static WindowTint GetWindowTint(this IVehicle vehicle) => (WindowTint)vehicle.WindowTint;
コード例 #52
0
 public virtual IVehicle CreateSport()
 {
     _Sport = _Sport ?? new Sport(new StandardEngine(_ENGINE_SIZE));
     return((IVehicle)_Sport.Clone());
 }
コード例 #53
0
 public virtual IVehicle CreatePickup()
 {
     _Pickup = _Pickup ?? new Pickup(new StandardEngine(_ENGINE_SIZE));
     return((IVehicle)_Pickup.Clone());
 }
コード例 #54
0
 public WithMissles(IVehicle vehicle) : base(vehicle)
 {
 }
コード例 #55
0
 public WithOrnament(IVehicle vehicle) : base(vehicle)
 {
 }
コード例 #56
0
 public void RemoveVehicle(IVehicle vehicle)
 {
     Alt.Module.OnVehicleRemove(vehicle.NativePointer);
     Alt.Module.OnRemoveVehicle(vehicle.NativePointer);
 }
コード例 #57
0
 public VehicleDecorator(IVehicle vehicle)
 {
     m_DecoratedVehicle = vehicle;
 }
コード例 #58
0
 public WithAirFreshener(IVehicle vehicle) : base(vehicle)
 {
 }
コード例 #59
0
        public string Park(string type, string model, string number)
        {
            IVehicle vehicle = VehicleFactory.GetVehicleType(type, model, number);

            return(_service.Park(vehicle));
        }
コード例 #60
0
 public virtual IVehicle CreateCoupe()
 {
     _Coupe = _Coupe ?? new Coupe(new StandardEngine(_ENGINE_SIZE));
     return((IVehicle)_Coupe.Clone());
 }