Пример #1
0
        public static async Task LoadServerEntity()
        {
            RoleplayContext ctx = Singleton.GetDatabaseInstance();

            using (UnitOfWork unit = new UnitOfWork(ctx))
            {
                await BuildingEntity.LoadBuildingsAsync(unit);

                await AtmEntity.LoadAtmsAsync(unit);

                await BusEntity.LoadBusAsync(unit);

                await ShopEntity.LoadShopAsync(unit);

                await GroupEntity.LoadGroupsAsync(unit);

                await WarehouseOrderEntity.LoadWarehouseOrdersAsync();
            }

            JobEntity courierJob = new JobEntity(new JobEntityModel()
            {
                JobName                = "Kurier",
                VehicleModel           = AltV.Net.Enums.VehicleModel.Boxville2,
                RespawnVehicle         = true,
                Position               = new Position(26.1626f, -1300.59f, 29.2124f),
                RespawnVehiclePosition = new Position(36.9495f, -1283.84f, 29.2799f),
                RespawnVehicleRotation = new Rotation(0, 0, 1.53369f),
                JobType                = JobType.Courier,
                MaxSalary              = 400
            });

            courierJob.Create();

            JobEntity junkerJob = new JobEntity(new JobEntityModel()
            {
                JobName                = "Śmieciarz",
                VehicleModel           = AltV.Net.Enums.VehicleModel.Trash,
                RespawnVehicle         = true,
                Position               = new Position(500.334f, -652.009f, 24.8989f),
                RespawnVehiclePosition = new Position(508.286f, -609.771f, 25.1348f),
                RespawnVehicleRotation = new Rotation(0, 0, 1.63264f),
                JobType                = JobType.Junker,
                MaxSalary              = 400
            });

            junkerJob.Create();

            JobCenterEntity jobCenter = new JobCenterEntity(new JobCenterModel()
            {
                Id       = 0,
                Position = new Position(104.73f, -934.075f, 29.8022f),
                Jobs     = EntityHelper.GetJobs()
            });

            jobCenter.Spawn();
        }
Пример #2
0
 public static void Add(JobCenterEntity jobCenterEntity) => JobCenters.Add(jobCenterEntity);