converted jobs to same system as businesses, add option to choose job at cityhall
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Entities
|
||||
{
|
||||
public class Job
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Business;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -23,7 +24,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "ShopVehicle";
|
||||
return "ShopVehicle | Shop: " + BusinessManager.GetBusiness(BusinessId).Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace ReallifeGamemode.Server.Entities
|
||||
|
||||
public GroupRank GroupRank { get; set; }
|
||||
|
||||
public Job Job { get; set; }
|
||||
public int? JobId { get; set; }
|
||||
|
||||
public FactionRank GetFactionRank()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user