location heading

This commit is contained in:
hydrant
2019-09-29 22:32:06 +02:00
parent 6a23f6ef59
commit 05ee31dbd1
6 changed files with 1366 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ namespace ReallifeGamemode.DataService.Controllers
foreach(var location in list)
{
locations.Add($"{location.Description.PadRight(20)} - {Math.Round(location.X, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Y, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Z, 2).ToString(CultureInfo.InvariantCulture)}");
locations.Add($"{Uri.EscapeDataString(location.Description).PadRight(20)} - {Math.Round(location.X, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Y, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Z, 2).ToString(CultureInfo.InvariantCulture)} - Richtung: {Math.Round(location.Heading, 2)}");
}
return locations;

View File

@@ -17,5 +17,7 @@ namespace ReallifeGamemode.Database.Entities
public double Y { get; set; }
public double Z { get; set; }
public double Heading { get; set; }
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Database.Migrations
{
public partial class SavedLocationsHeading : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<double>(
name: "Heading",
table: "Locations",
nullable: false,
defaultValue: 0.0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Heading",
table: "Locations");
}
}
}

View File

@@ -543,6 +543,8 @@ namespace ReallifeGamemode.Database.Migrations
b.Property<string>("Description");
b.Property<double>("Heading");
b.Property<double>("X");
b.Property<double>("Y");

View File

@@ -1905,6 +1905,7 @@ namespace ReallifeGamemode.Server.Commands
X = player.Position.X,
Y = player.Position.Y,
Z = player.Position.Z,
Heading = player.Heading
});
dbContext.SaveChanges();