haus system auf core geändert

This commit is contained in:
hydrant
2020-03-29 12:18:17 +02:00
parent 6bd3d4a3d0
commit bcfc2105ea
68 changed files with 1366 additions and 810 deletions

View File

@@ -2,6 +2,8 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using GTANetworkAPI;
using ReallifeGamemode.Server.Core.API;
using ReallifeGamemode.Server.Core.RageMP;
namespace ReallifeGamemode.Database.Entities
{
@@ -28,11 +30,17 @@ namespace ReallifeGamemode.Database.Entities
[NotMapped]
public Vector3 Position => new Vector3(X, Y, Z);
[NotMapped]
public Position NewPosition => new Position(X, Y, Z);
[ForeignKey("Owner")]
public int? OwnerId { get; set; }
public User Owner { get; set; }
[NotMapped]
public Player User => Owner?.Player;
[NotMapped]
public IPlayer OwnerPlayer => new RagePlayer(User);
}
}

View File

@@ -4,6 +4,8 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using GTANetworkAPI;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Core.API;
using ReallifeGamemode.Server.Core.RageMP;
using ReallifeGamemode.Server.Types;
/**
@@ -104,6 +106,9 @@ namespace ReallifeGamemode.Database.Entities
get => NAPI.Pools.GetAllPlayers().Where(c => c.Name.ToLower() == this.Name.ToLower()).FirstOrDefault();
}
[NotMapped]
public IPlayer NewPlayer => new RagePlayer(Player);
public override string BankAccountName => Name;
}
}

View File

@@ -17,6 +17,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ReallifeGamemode.Server.Core.API\ReallifeGamemode.Server.Core.API.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Server.Core.RageMP\ReallifeGamemode.Server.Core.RageMP.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Server.Types\ReallifeGamemode.Server.Types.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Services\ReallifeGamemode.Services.csproj" />
</ItemGroup>