converted jobs to same system as businesses, add option to choose job at cityhall
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ReallifeGamemode.Server.Job;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -9,11 +11,14 @@ namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public class JobVehicle : ServerVehicle
|
||||
{
|
||||
public virtual Job Job { get; set; }
|
||||
public int JobId { get; set; }
|
||||
|
||||
public JobBase GetJob() => JobManager.GetJob(JobId);
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
return "Job Fahrzeug | Job: " + dbContext.JobVehicles.Include(j => j.Job).First(j => j.Id == this.Id).Job.Name;
|
||||
return "Job Fahrzeug | Job: " + this.GetJob().Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user