2023-08-30 21:46:11 -07:00
|
|
|
using Content.Shared.Players;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Server.Player;
|
2023-08-30 21:46:11 -07:00
|
|
|
using Robust.Shared.Players;
|
2018-08-21 00:59:04 +02:00
|
|
|
|
|
|
|
|
namespace Content.Server.Players
|
|
|
|
|
{
|
|
|
|
|
public static class PlayerDataExt
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the correctly cast instance of content player data from an engine player data storage.
|
|
|
|
|
/// </summary>
|
2023-08-30 21:46:11 -07:00
|
|
|
public static PlayerData? ContentData(this IPlayerSession session)
|
2018-08-21 00:59:04 +02:00
|
|
|
{
|
2023-08-30 21:46:11 -07:00
|
|
|
return session.Data.ContentData();
|
2018-08-21 00:59:04 +02:00
|
|
|
}
|
|
|
|
|
|
2023-08-30 21:46:11 -07:00
|
|
|
public static PlayerData? ContentData(this ICommonSession session)
|
2018-08-21 00:59:04 +02:00
|
|
|
{
|
2023-08-30 21:46:11 -07:00
|
|
|
return ((IPlayerSession) session).ContentData();
|
2018-08-21 00:59:04 +02:00
|
|
|
}
|
2023-06-21 13:04:07 +12:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the mind that is associated with this player.
|
|
|
|
|
/// </summary>
|
2023-08-28 16:53:24 -07:00
|
|
|
public static EntityUid? GetMind(this IPlayerSession session)
|
2023-06-21 13:04:07 +12:00
|
|
|
{
|
|
|
|
|
return session.Data.ContentData()?.Mind;
|
|
|
|
|
}
|
2018-08-21 00:59:04 +02:00
|
|
|
}
|
|
|
|
|
}
|