converted jobs to same system as businesses, add option to choose job at cityhall

This commit is contained in:
hydrant
2019-05-16 14:52:19 +02:00
parent 8fd4041b3c
commit aa81fa95a4
18 changed files with 1422 additions and 59 deletions

View File

@@ -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;
}
}
}