Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Commit

Permalink
VehicleHandler #12 - Zwischenstand implementierung weiterer VehicleHa…
Browse files Browse the repository at this point in the history
…ndler Tabellen
  • Loading branch information
Ruffo324 committed Jan 17, 2018
1 parent 0c4aa76 commit 3664cc4
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Server\Entity\ComponentDto.cs" />
<Compile Include="Server\Entity\VehicleColorDto.cs" />
<Compile Include="Server\Entity\VehicleComponentDto.cs" />
<Compile Include="Server\Entity\DoorStateDto.cs" />
<Compile Include="Server\Entity\VehicleDto.cs" />
<Compile Include="Server\Entity\VehicleContext.cs" />
Expand Down
23 changes: 23 additions & 0 deletions EvoMp/EvoMp.Module.VehicleHandler/Server/Entity/ComponentDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using EvoMp.Module.VehicleHandler.Server.Enum;
using GrandTheftMultiplayer.Shared;
using GrandTheftMultiplayer.Shared.Math;

namespace EvoMp.Module.VehicleHandler.Server.Entity
{
[Table("VehicleComponents")]
public class ComponentDto
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key, Column(Order = 0)]
public VehicleDto ComponentId { get; set; }

[Key, Column("Slot", Order = 1)]
public int Slot { get; set; }

[Key, Column("Value", Order = 2)]
public int Value { get; set; }

}
}
25 changes: 25 additions & 0 deletions EvoMp/EvoMp.Module.VehicleHandler/Server/Entity/VehicleColorDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using EvoMp.Module.VehicleHandler.Server.Enum;
using GrandTheftMultiplayer.Shared;
using GrandTheftMultiplayer.Shared.Math;

namespace EvoMp.Module.VehicleHandler.Server.Entity
{
[Table("VehicleColors")]
public class VehicleColorDto
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key, Column(Order = 0)]
public int VehicleColorId { get; set; }

[Key, Column("Red", Order = 1)]
public int Red { get; set; }

[Key, Column("Green", Order = 2)]
public int Green { get; set; }

[Key, Column("Blue", Order = 3)]
public int Blue { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using EvoMp.Module.VehicleHandler.Server.Enum;
using GrandTheftMultiplayer.Shared;
using GrandTheftMultiplayer.Shared.Math;

namespace EvoMp.Module.VehicleHandler.Server.Entity
{
[Table("VehicleComponentMappings")]
public class VehicleComponentDto
{
[Key]
public VehicleDto Vehicle { get; set; }

[Key, Column(Order = 1)]
public ComponentDto Component { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ public VehicleContext() : base(Environment.GetEnvironmentVariable("NameOrConnect
{
}

// Tables
#region Tables
public DbSet<VehicleDto> Vehicles { get; set; }

public DbSet<DoorStateDto> DoorStates { get; set; }

//public DbSet<ComponentDto> Components { get; set; }

//public DbSet<VehicleComponentDto> VehicleComponents { get; set; }

public DbSet<VehicleColorDto> VehicleColors { get; set; }
#endregion Tables

// Overwriting Convention to allow private fields
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
Expand Down
8 changes: 6 additions & 2 deletions EvoMp/EvoMp.Module.VehicleHandler/Server/Entity/VehicleDto.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using EvoMp.Module.VehicleHandler.Server.Enum;
Expand Down Expand Up @@ -61,8 +62,11 @@ public Vector3 Rotation
[Column("Zr")]
private double Zr { get; set; }

//public string PrimaryColorID { get; set; }
//public string SecondaryColorID { get; set; }
[Column("PrimaryColor")]
public VehicleColorDto PrimaryColor { get; set; }

[Column("SecondaryColor")]
public VehicleColorDto SecondaryColor { get; set; }

[Column("NumberplateValue")]
public string NumberplateValue { get; set; }
Expand Down

0 comments on commit 3664cc4

Please sign in to comment.