Пример #1
0
        public static void Main(string[] args)
        {
            try
            {
                Trace("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n");
                Trace("Begin ManualTestSimpleVehicle.Main\n");

                SimpleVehicle v1 = new SimpleVehicle();
                int           i  = v1.SimpleMethod();
                SimpleVehicle v2 = v1.ObjectMethod();

                Trace(System.String.Format("i: {0}\n", i));
                Trace(System.String.Format("v1.CppThis: {0}\n", v1.GetCppThis().Handle));
                Trace(System.String.Format("v2.CppThis: {0}\n",
                                           null == v2 ? System.IntPtr.Zero : v2.GetCppThis().Handle));

                v1 = null;
                v2 = null;
                System.GC.Collect();

                Trace("End ManualTestSimpleVehicle.Main\n");
            }
            catch (Exception exc)
            {
                Trace(exc.ToString());
                throw;
            }
        }
Пример #2
0
        public override void _Ready()
        {
            var size = GetViewportRect().Size;
            var path = new SimplePath();

            path.Points.Add(new Vector2(0, size.y / 2));
            path.Points.Add(new Vector2(size.x / 8, size.y * 3 / 4));
            path.Points.Add(new Vector2(size.x / 2, (size.y / 2) - 50));
            path.Points.Add(new Vector2(size.x, size.y / 2));
            AddChild(path);

            var vehicle1 = new SimpleVehicle()
            {
                Position   = new Vector2(100, 100),
                TargetPath = path
            };

            AddChild(vehicle1);

            var vehicle2 = new SimpleVehicle()
            {
                Position   = new Vector2(100, size.y - 100),
                TargetPath = path
            };

            AddChild(vehicle2);
        }
Пример #3
0
        public async Task <IActionResult> Receipt(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var parkedVehicle = await _context.ParkedVehicle.FirstOrDefaultAsync(m => m.Id == id);

            if (parkedVehicle == null)
            {
                return(NotFound());
            }

            var receipt = new SimpleVehicle
            {
                Id            = parkedVehicle.Id,
                VehicleType   = parkedVehicle.VehicleType.ToString(),
                LicenceNr     = parkedVehicle.LicenceNr,
                ArrivalTime   = parkedVehicle.ArrivalTime,
                DepartureTime = DateTime.Now,
                ParkedHours   = Convert.ToInt32((DateTime.Now - parkedVehicle.ArrivalTime).TotalHours),
                Price         = priceSettings.Value.Price * Convert.ToInt32((DateTime.Now - parkedVehicle.ArrivalTime).TotalHours) * vehicleWidth[parkedVehicle.VehicleType],
                StartLocation = GetParkingSpots(parkedVehicle)
            };



            _context.ParkedVehicle.Remove(parkedVehicle);
            await _context.SaveChangesAsync();

            return(View(receipt));
        }
Пример #4
0
        public static void Main(string[] args)
        {
            try
              {
            Trace("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n");
            Trace("Begin ManualTestSimpleVehicle.Main\n");

            SimpleVehicle v1 = new SimpleVehicle();
            int i = v1.SimpleMethod();
            SimpleVehicle v2 = v1.ObjectMethod();

            Trace(System.String.Format("i: {0}\n", i));
            Trace(System.String.Format("v1.CppThis: {0}\n", v1.GetCppThis().Handle));
            Trace(System.String.Format("v2.CppThis: {0}\n",
              null == v2 ? System.IntPtr.Zero : v2.GetCppThis().Handle));

            v1 = null;
            v2 = null;
            System.GC.Collect();

            Trace("End ManualTestSimpleVehicle.Main\n");
              }
              catch(Exception exc)
              {
            Trace(exc.ToString());
            throw;
              }
        }
Пример #5
0
 private void Awake()
 {
     m_data.passengerIds = new int[4];
     m_vehicle           = GetComponent <SimpleVehicle>();
     m_server            = Object.FindObjectOfType <LidServer>();
     m_spawnPoint        = (m_lastPos = base.transform.position);
     KillAndResetPassengers();
 }
Пример #6
0
        public void Construct()
        {
            SimpleVehicle v = new SimpleVehicle();

            Assert.AreEqual(Vector3.Zero, v.Acceleration);
            Assert.AreEqual(Vector3.Backward, v.Forward);
            Assert.AreEqual(Vector3.Zero, v.Velocity);
            Assert.AreEqual(0, v.Speed);
            Assert.AreEqual(Vector3.Zero, v.SmoothedPosition);
        }
 public OptimalRoute.GeoCoords GetVehicleCurrentPosition(string hashcode)
 {
     try
     {
         SimpleVehicle v = GetVehicle(hashcode);
         return(new OptimalRoute.GeoCoords(v.lat, v.lng));
     }
     catch (Exception ex)
     {
         //MessageBox.Show(hashcode + "   "+ex.Message);
         return(null);
     }
 }
Пример #8
0
        public override void _Ready()
        {
            var size = GetViewportRect().Size;

            var field = new CustomFlowField()
            {
                Resolution = 30
            };

            AddChild(field);

            var vehicle = new SimpleVehicle()
            {
                TargetFlow = field,
                Position   = size / 2
            };

            AddChild(vehicle);
        }
Пример #9
0
        public override void _Ready()
        {
            var size = GetViewportRect().Size;

            var path = new SimplePath();

            path.Points.Add(new Vector2(0, size.y / 3));
            path.Points.Add(new Vector2(size.x, 2 * size.y / 3));
            AddChild(path);

            var vehicle = new SimpleVehicle()
            {
                TargetPath = path,
                Velocity   = new Vector2(10, 0),
                Position   = new Vector2(100, 100)
            };

            AddChild(vehicle);
        }
Пример #10
0
            public override void _Ready()
            {
                var size = GetViewportRect().Size;

                // Create target
                targetMover = new SimpleMover()
                {
                    Position = size / 2,
                    Modulate = Colors.LightBlue.WithAlpha(128)
                };
                AddChild(targetMover);

                // Create vehicle
                var vehicle = new SimpleVehicle()
                {
                    Target   = targetMover,
                    Position = size / 4
                };

                AddChild(vehicle);
            }
Пример #11
0
        public override void _Ready()
        {
            var size      = GetViewportRect().Size;
            var flowField = new ImageFlowField()
            {
                TextureScale   = 8,
                Resolution     = 30,
                CenterOnScreen = true,
                SourceTexture  = (Texture)GD.Load("res://assets/textures/sample-texture.png")
            };

            AddChild(flowField);

            var vehicle = new SimpleVehicle()
            {
                TargetFlow = flowField,
                Position   = new Vector2(10, size.y / 2),
            };

            vehicle.Velocity = Vector2.Right * vehicle.MaxVelocity;
            AddChild(vehicle);
        }