示例#1
0
 void HandleStatusChanged(object sender, GaragesChangedEventArgs e)
 {
     Console.WriteLine($"ViewModel handling StatusChanged event with [{e.Garages}]");
     Garages     = e.Garages;
     IsConnected = _service.IsConnected;
     Status      = _service.IsConnected ? CONNECTED_STATUS : NOT_CONNECTED_STATUS;
 }
示例#2
0
        private void ParkInGarageEvent(Client client, string eventName, object[] arguments)
        {
            CloseWindow(client);
            var garage = Garages.FirstOrDefault(x => x.Position.FromJson <Vector3>().DistanceTo(client.position) <= 2f);

            if (garage == null)
            {
                client.sendColoredNotification("Du bist zu weit von einer Garage entfernt..", (int)HudColor.HUD_COLOUR_PURE_WHITE, (int)HudColor.HUD_COLOUR_RED);
                return;
            }
            if (garage.ParkOutSpots.Count == 0)
            {
                client.sendColoredNotification($"Es wurde kein Ausparkpunkt gefunden.. Melde dies einem Admin ({garage.Id})", (int)HudColor.HUD_COLOUR_PURE_WHITE, (int)HudColor.HUD_COLOUR_RED);
                return;
            }
            OwnedVehicle vehicle = OwnedVehicleController.ExistingVehicles.FirstOrDefault(x => client.Account().CurrentCharacter.KeyRing.VehicleKeys.Keys.ToList().Contains(x.Id) &&
                                                                                          x.Handle.position.DistanceTo(garage.ParkInSpots[0].Position) <= garage.ParkInSpots[0].Radius);

            if (vehicle == null)
            {
                client.sendColoredNotification("Es wurde kein einparkbares Fahrzeug gefunden..", (int)HudColor.HUD_COLOUR_PURE_WHITE, (int)HudColor.HUD_COLOUR_RED);
                return;
            }
            OwnedVehicleController.ParkVehicle(vehicle, garage.Id, false);
            client.sendColoredNotification("Das Fahrzeug wurde erfolgreich eingeparkt.", (int)HudColor.HUD_COLOUR_PURE_WHITE, (int)HudColor.HUD_COLOUR_GREEN);
        }
示例#3
0
 public Api(ILoggerService logger)
 {
     Users   = new Users(logger);
     Reports = new Reports();
     Garages = new Garages();
     Gangs   = new Gangs();
 }
示例#4
0
        private void ParkOutVehicleEvent(Client client, string eventName, object[] arguments)
        {
            CloseWindow(client);
            int id     = Convert.ToInt32(arguments[0]);
            var garage = Garages.FirstOrDefault(x => x.Position.FromJson <Vector3>().DistanceTo(client.position) <= 2f);

            if (garage == null)
            {
                return;
            }
            GarageParkOutSpot foundSpot = null;

            foreach (GarageParkOutSpot spot in garage.ParkOutSpots)
            {
                if (OwnedVehicleController.IsAnyVehicleBlockingThisArea(spot.Position, spot.Radius))
                {
                    continue;
                }
                else
                {
                    foundSpot = spot;
                    break;
                }
            }
            if (foundSpot != null)
            {
                OwnedVehicleController.ParkOutVehicle(id, foundSpot.Position, foundSpot.Rotation);
                client.sendColoredNotification("Das Fahrzeug wurde erfolgreich ausgeparkt.", (int)HudColor.HUD_COLOUR_PURE_WHITE, (int)HudColor.HUD_COLOUR_GREEN);
            }
            else
            {
                client.sendColoredNotification("Es wurde kein freier Parkplatz gefunden..", (int)HudColor.HUD_COLOUR_PURE_WHITE, (int)HudColor.HUD_COLOUR_RED);
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,CityID,Address,Coord_X,Coord_Y,Convenience")] Garages garages)
        {
            if (id != garages.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(garages);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GaragesExists(garages.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(garages));
        }
示例#6
0
        public bool Equals(SaveFileGTA3 other)
        {
            if (other == null)
            {
                return(false);
            }

            return(SimpleVars.Equals(other.SimpleVars) &&
                   Scripts.Equals(other.Scripts) &&
                   PlayerPeds.Equals(other.PlayerPeds) &&
                   Garages.Equals(other.Garages) &&
                   Vehicles.Equals(other.Vehicles) &&
                   Objects.Equals(other.Objects) &&
                   Paths.Equals(other.Paths) &&
                   Cranes.Equals(other.Cranes) &&
                   Pickups.Equals(other.Pickups) &&
                   PhoneInfo.Equals(other.PhoneInfo) &&
                   RestartPoints.Equals(other.RestartPoints) &&
                   RadarBlips.Equals(other.RadarBlips) &&
                   Zones.Equals(other.Zones) &&
                   Gangs.Equals(other.Gangs) &&
                   CarGenerators.Equals(other.CarGenerators) &&
                   ParticleObjects.Equals(other.ParticleObjects) &&
                   AudioScriptObjects.Equals(other.AudioScriptObjects) &&
                   PlayerInfo.Equals(other.PlayerInfo) &&
                   Stats.Equals(other.Stats) &&
                   Streaming.Equals(other.Streaming) &&
                   PedTypeInfo.Equals(other.PedTypeInfo));
        }
 public void Output()//method of outputting content of motorcade
 {
     Console.WriteLine($"Motorcade under the direction of Chief: {Chief}");
     Console.WriteLine("Garages:");
     Garages.ForEach(garage => Console.WriteLine(garage));
     Console.WriteLine("Vehicles:");
     Vehicles.ForEach(vehicle => Console.WriteLine(vehicle));
 }
        public async Task <Garages> GetGarages()
        {
            var garages = new Garages();

            using (var bc = new BusinessController())
                garages = bc.GetGarages().Result;

            return(garages);
        }
示例#9
0
        private void InteractionController_OnPlayerInteractOnFoot(object sender, Client e)
        {
            var garage = Garages.FirstOrDefault(x => x.Position.FromJson <Vector3>().DistanceTo(e.position) <= 1f);

            if (garage == null)
            {
                return;
            }
            OpenParkOverviewWindow(e, garage);
        }
        public async Task <IActionResult> Create([Bind("ID,Name,CityID,Address,Coord_X,Coord_Y,Convenience")] Garages garages)
        {
            if (ModelState.IsValid)
            {
                _context.Add(garages);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(garages));
        }
示例#11
0
        public bool Equals(SaveFileLCS other)
        {
            if (other == null)
            {
                return(false);
            }

            return(SimpleVars.Equals(other.SimpleVars) &&
                   Scripts.Equals(other.Scripts) &&
                   Garages.Equals(other.Garages) &&
                   PlayerInfo.Equals(other.PlayerInfo) &&
                   Stats.Equals(other.Stats));
        }
示例#12
0
        public bool Equals(SaveFileIV other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Name.Equals(other.Name) &&
                   TimeStamp.Equals(other.TimeStamp) &&
                   SaveVersion.Equals(other.SaveVersion) &&
                   SaveSizeInBytes.Equals(other.SaveSizeInBytes) &&
                   ScriptSpaceSize.Equals(other.ScriptSpaceSize) &&
                   SimpleVars.Equals(other.SimpleVars) &&
                   PlayerInfo.Equals(other.PlayerInfo) &&
                   ExtraContent.Equals(other.ExtraContent) &&
                   Scripts.Equals(other.Scripts) &&
                   Garages.Equals(other.Garages) &&
                   GameLogic.Equals(other.GameLogic) &&
                   Paths.Equals(other.Paths) &&
                   Pickups.Equals(other.Pickups) &&
                   RestartPoints.Equals(other.RestartPoints) &&
                   RadarBlips.Equals(other.RadarBlips) &&
                   Zones.Equals(other.Zones) &&
                   GangData.Equals(other.GangData) &&
                   CarGenerators.Equals(other.CarGenerators) &&
                   Stats.Equals(other.Stats) &&
                   IplStore.Equals(other.IplStore) &&
                   StuntJumps.Equals(other.StuntJumps) &&
                   Radio.Equals(other.Radio) &&
                   Objects.Equals(other.Objects) &&
                   Relationships.Equals(other.Relationships) &&
                   Inventory.Equals(other.Inventory) &&
                   UnusedPools.Equals(other.UnusedPools) &&
                   UnusedPhoneInfo.Equals(other.UnusedPhoneInfo) &&
                   UnusedAudioScript.Equals(other.UnusedAudioScript) &&
                   UnusedSetPieces.Equals(other.UnusedSetPieces) &&
                   UnusedStreaming.Equals(other.UnusedStreaming) &&
                   UnusedPedTypeInfo.Equals(other.UnusedPedTypeInfo) &&
                   UnusedTags.Equals(other.UnusedTags) &&
                   UnusedShopping.Equals(other.UnusedShopping) &&
                   UnusedGangWars.Equals(other.UnusedGangWars) &&
                   UnusedEntryExits.Equals(other.UnusedEntryExits) &&
                   Unused3dMarkers.Equals(other.Unused3dMarkers) &&
                   UnusedVehicles.Equals(other.UnusedVehicles) &&
                   UnusedExtraBlock.Equals(other.UnusedExtraBlock) &&
                   GfwlData.Equals(other.GfwlData));
        }
示例#13
0
        public bool Equals(GarageData other)
        {
            if (other == null)
            {
                return(false);
            }

            return(NumGarages.Equals(other.NumGarages) &&
                   FreeBombs.Equals(other.FreeBombs) &&
                   FreeResprays.Equals(other.FreeResprays) &&
                   CarsCollected.Equals(other.CarsCollected) &&
                   BankVansCollected.Equals(other.BankVansCollected) &&
                   PoliceCarsCollected.Equals(other.PoliceCarsCollected) &&
                   CarTypesCollected1.Equals(other.CarTypesCollected1) &&
                   CarTypesCollected2.Equals(other.CarTypesCollected2) &&
                   CarTypesCollected3.Equals(other.CarTypesCollected3) &&
                   LastTimeHelpMessage.Equals(other.LastTimeHelpMessage) &&
                   CarsInSafeHouse.SequenceEqual(other.CarsInSafeHouse) &&
                   Garages.SequenceEqual(other.Garages));
        }
示例#14
0
        public bool AddGarage(Garage newGarage)//method for adding a new garage to a motorcade
        {
            if (Garages.Count > 9)
            {
                Console.WriteLine($"No more space in list of garages for: {newGarage}.");
                return(false);
            }

            foreach (Garage gar in Garages)
            {
                if (gar.Equals(newGarage))
                {
                    Console.WriteLine($"{newGarage} already exists among garages.");
                    return(false);
                }
            }

            Garages.Add(newGarage);
            return(true);
        }
示例#15
0
        public bool Equals(SaveFileSA other)
        {
            if (other == null)
            {
                return(false);
            }

            return(SimpleVars.Equals(other.SimpleVars) &&
                   Scripts.Equals(other.Scripts) &&
                   Pools.Equals(other.Pools) &&
                   Garages.Equals(other.Garages) &&
                   GameLogic.Equals(other.GameLogic) &&
                   Paths.Equals(other.Paths) &&
                   Pickups.Equals(other.Pickups) &&
                   PhoneInfo.Equals(other.PhoneInfo) &&
                   RestartPoints.Equals(other.RestartPoints) &&
                   RadarBlips.Equals(other.RadarBlips) &&
                   Zones.Equals(other.Zones) &&
                   GangData.Equals(other.GangData) &&
                   CarGenerators.Equals(other.CarGenerators) &&
                   PedGenerators.Equals(other.PedGenerators) &&
                   AudioScriptObjects.Equals(other.AudioScriptObjects) &&
                   PlayerInfo.Equals(other.PlayerInfo) &&
                   Stats.Equals(other.Stats) &&
                   SetPieces.Equals(other.SetPieces) &&
                   Streaming.Equals(other.Streaming) &&
                   PedTypeInfo.Equals(other.PedTypeInfo) &&
                   Tags.Equals(other.Tags) &&
                   IplStore.Equals(other.IplStore) &&
                   Shopping.Equals(other.Shopping) &&
                   GangWars.Equals(other.GangWars) &&
                   StuntJumps.Equals(other.StuntJumps) &&
                   EntryExits.Equals(other.EntryExits) &&
                   Radio.Equals(other.Radio) &&
                   User3dMarkers.Equals(other.User3dMarkers) &&
                   PostEffects.Equals(other.PostEffects));
        }
示例#16
0
        private void ParkOutGarageEvent(Client client, string eventName, object[] arguments)
        {
            Character ch     = client.Account().CurrentCharacter;
            var       garage = Garages.FirstOrDefault(x => x.Position.FromJson <Vector3>().DistanceTo(client.position) <= 1f);

            if (garage == null)
            {
                return;
            }
            List <GarageVehicleList> list     = new List <GarageVehicleList>();
            List <OwnedVehicle>      vehicles = new List <OwnedVehicle>();

            using (var db = new Database())
            {
                vehicles = db.OwnedVehicles.Where(x => ch.KeyRing.VehicleKeys.Keys.ToList().Contains(x.Id) && x.InGarage && x.CanParkOutEverywhere ||
                                                  ch.KeyRing.VehicleKeys.Keys.ToList().Contains(x.Id) && !x.CanParkOutEverywhere && garage.Id == x.LastGarageId).ToList();
            }

            foreach (OwnedVehicle vehicle in vehicles)
            {
                list.Add(new GarageVehicleList
                {
                    Id    = vehicle.Id.ToString(),
                    Title = vehicle.ModelName
                });
            }

            if (list.Count == 0)
            {
                list.Add(new GarageVehicleList
                {
                    Id    = "0",
                    Title = "Es wurden keine Fahrzeuge gefunden.."
                });
            }
            client.triggerEvent("showBrowser", Constants.GarageParkOutListUrl, "FillWindow", JsonConvert.SerializeObject(list));
        }
示例#17
0
 private void Locations_DoubleClick(object sender, EventArgs e)
 {
     updategarages();
     Garages.Update();
 }
示例#18
0
 private void Search_Click(object sender, EventArgs e)
 {
     updategarages();
     Garages.Update();
 }
示例#19
0
 /// <summary>
 /// Method that can add garage to list of garages
 /// </summary>
 /// <param name="garage">Garage which needed to add</param>
 public void AddGarage(Garage garage)
 {
     Garages.Add(garage);
 }
示例#20
0
 public IEnumerator <Garage> GetEnumerator()
 {
     return(Garages.GetEnumerator());
 }