continue Gangwar System

This commit is contained in:
Lukas Moungos
2019-11-30 18:54:11 +01:00
parent e3dbf7c4e1
commit a4303a1a01
14 changed files with 1904 additions and 6 deletions

View File

@@ -0,0 +1,31 @@
using GTANetworkAPI;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
namespace ReallifeGamemode.Database.Entities
{
public class Turfs
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[ForeignKey("Faction")]
public int? FactionId { get; set; }
public static Faction Faction { get; set; }
public string Owner { get; set; }
public string Name { get; set; }
public int X { get; set; }
public int Y { get; set; }
public int Rotation { get; set; }
public int Range { get; set; }
public int Color { get; set; }
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Database.Migrations
{
public partial class Turfs : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Turfs",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
FactionId = table.Column<int>(nullable: true),
Owner = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
X = table.Column<int>(nullable: false),
Y = table.Column<int>(nullable: false),
Rotation = table.Column<float>(nullable: false),
Range = table.Column<float>(nullable: false),
Color = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Turfs", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Turfs");
}
}
}

View File

@@ -890,6 +890,32 @@ namespace ReallifeGamemode.Database.Migrations
b.ToTable("TuningGarages");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Turfs", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("Color");
b.Property<int?>("FactionId");
b.Property<string>("Name");
b.Property<string>("Owner");
b.Property<float>("Range");
b.Property<float>("Rotation");
b.Property<int>("X");
b.Property<int>("Y");
b.HasKey("Id");
b.ToTable("Turfs");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.User", b =>
{
b.Property<int>("Id")

View File

@@ -122,5 +122,8 @@ namespace ReallifeGamemode.Database.Models
//Driving/Bike/Flight School
public DbSet<Entities.SchoolVehicle> SchoolVehicles { get; set; }
//Gangwar
public DbSet<Entities.Turfs> Turfs { get; set; }
}
}