2023-06-18 11:33:19 -07:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
|
2023-08-30 21:46:11 -07:00
|
|
|
namespace Content.Shared.Mind.Components
|
2018-08-21 00:59:04 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2023-08-28 16:53:24 -07:00
|
|
|
/// Stores a <see cref="MindComponent"/> on a mob.
|
2018-08-21 00:59:04 +02:00
|
|
|
/// </summary>
|
2023-08-30 21:46:11 -07:00
|
|
|
[RegisterComponent, Access(typeof(SharedMindSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class MindContainerComponent : Component
|
2018-08-21 00:59:04 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The mind controlling this mob. Can be null.
|
|
|
|
|
/// </summary>
|
2018-09-09 15:34:43 +02:00
|
|
|
[ViewVariables]
|
2023-08-30 21:46:11 -07:00
|
|
|
[Access(typeof(SharedMindSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
|
2023-08-28 16:53:24 -07:00
|
|
|
public EntityUid? Mind { get; set; }
|
2018-08-21 00:59:04 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// True if we have a mind, false otherwise.
|
|
|
|
|
/// </summary>
|
2018-09-09 15:34:43 +02:00
|
|
|
[ViewVariables]
|
2023-06-18 11:33:19 -07:00
|
|
|
[MemberNotNullWhen(true, nameof(Mind))]
|
2018-08-21 00:59:04 +02:00
|
|
|
public bool HasMind => Mind != null;
|
|
|
|
|
|
2020-04-20 11:37:05 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether examining should show information about the mind or not.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("showExamineInfo")]
|
2021-01-01 16:11:17 +01:00
|
|
|
public bool ShowExamineInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the mind will be put on a ghost after this component is shutdown.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("ghostOnShutdown")]
|
2023-08-30 21:46:11 -07:00
|
|
|
[Access(typeof(SharedMindSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
|
2021-03-05 01:08:38 +01:00
|
|
|
public bool GhostOnShutdown { get; set; } = true;
|
2018-08-21 00:59:04 +02:00
|
|
|
}
|
2021-03-31 14:17:22 -07:00
|
|
|
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class MindRemovedMessage : EntityEventArgs
|
2021-03-31 14:17:22 -07:00
|
|
|
{
|
2023-08-28 16:53:24 -07:00
|
|
|
public EntityUid OldMindId;
|
|
|
|
|
public MindComponent OldMind;
|
2023-08-14 19:34:23 -04:00
|
|
|
|
2023-08-28 16:53:24 -07:00
|
|
|
public MindRemovedMessage(EntityUid oldMindId, MindComponent oldMind)
|
2023-08-14 19:34:23 -04:00
|
|
|
{
|
2023-08-28 16:53:24 -07:00
|
|
|
OldMindId = oldMindId;
|
2023-08-14 19:34:23 -04:00
|
|
|
OldMind = oldMind;
|
|
|
|
|
}
|
2021-03-31 14:17:22 -07:00
|
|
|
}
|
2021-05-11 16:16:08 -07:00
|
|
|
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class MindAddedMessage : EntityEventArgs
|
2021-05-11 16:16:08 -07:00
|
|
|
{
|
|
|
|
|
}
|
2018-08-21 00:59:04 +02:00
|
|
|
}
|