RAGECOOP-V/Server/PlayerData.cs
2021-08-26 17:01:32 +02:00

34 lines
916 B
C#

namespace CoopServer
{
public struct PlayerData
{
public string SocialClubName { get; set; }
public string Username { get; set; }
private LVector3 LastPosition { get; set; }
private LVector3 CurrentPosition { get; set; }
public LVector3 Position
{
get
{
return CurrentPosition;
}
set
{
LastPosition = CurrentPosition;
CurrentPosition = value;
if (Server.GameMode != null && !LVector3.Equals(CurrentPosition, LastPosition))
{
Server.GameMode.API.InvokePlayerPositionUpdate(this);
}
}
}
public bool IsInRangeOf(LVector3 position, float distance)
{
return LVector3.Subtract(Position, position).Length() < distance;
}
}
}