add house position

This commit is contained in:
hydrant
2019-06-26 22:23:12 +02:00
parent 12803d03ad
commit dd647732c0
4 changed files with 1210 additions and 0 deletions

View File

@@ -19,6 +19,13 @@ namespace ReallifeGamemode.Server.Entities
public int Price { get; set; } public int Price { get; set; }
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
[NotMapped]
public Vector3 Position => new Vector3(X, Y, Z);
[ForeignKey("User")] [ForeignKey("User")]
public int? UserId { get; set; } public int? UserId { get; set; }
public User User { get; set; } public User User { get; set; }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Migrations
{
public partial class HousePosition : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<float>(
name: "X",
table: "Houses",
nullable: false,
defaultValue: 0f);
migrationBuilder.AddColumn<float>(
name: "Y",
table: "Houses",
nullable: false,
defaultValue: 0f);
migrationBuilder.AddColumn<float>(
name: "Z",
table: "Houses",
nullable: false,
defaultValue: 0f);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "X",
table: "Houses");
migrationBuilder.DropColumn(
name: "Y",
table: "Houses");
migrationBuilder.DropColumn(
name: "Z",
table: "Houses");
}
}
}

View File

@@ -415,6 +415,12 @@ namespace ReallifeGamemode.Migrations
b.Property<int?>("UserId"); b.Property<int?>("UserId");
b.Property<float>("X");
b.Property<float>("Y");
b.Property<float>("Z");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("UserId") b.HasIndex("UserId")