Added many things I can't recall but it has to do with inventory system and some minor fixes .. it's cool

This commit is contained in:
Lukas Moungos
2019-09-04 20:28:51 +02:00
parent 672702eef5
commit 068f3e2d91
34 changed files with 1057 additions and 269 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using ReallifeGamemode.Server.Models;
namespace ReallifeGamemode.Server.Entities
{
public class VehicleItem
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public int ItemId { get; set; }
[ForeignKey("ServerVehicle")]
public int VehicleId { get; set; }
public ServerVehicle Vehicle { get; set; }
public int Amount { get; set; }
public int Slot { get; set; }
public ServerVehicle GetVehicle()
{
using (var dbContext = new DatabaseContext())
{
return dbContext.ServerVehicles.FirstOrDefault(v => v.Id == VehicleId);
}
}
}
}