fish-station/Content.Server/Mind/Components/MindContainerComponent.cs
DrSmugleaf 15c0211fb2
Refactor minds to be entities with components, make roles components (#19591)
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
2023-08-28 16:53:24 -07:00

56 lines
1.8 KiB
C#

using System.Diagnostics.CodeAnalysis;
namespace Content.Server.Mind.Components
{
/// <summary>
/// Stores a <see cref="MindComponent"/> on a mob.
/// </summary>
[RegisterComponent, Access(typeof(MindSystem))]
public sealed partial class MindContainerComponent : Component
{
/// <summary>
/// The mind controlling this mob. Can be null.
/// </summary>
[ViewVariables]
[Access(typeof(MindSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
public EntityUid? Mind { get; set; }
/// <summary>
/// True if we have a mind, false otherwise.
/// </summary>
[ViewVariables]
[MemberNotNullWhen(true, nameof(Mind))]
public bool HasMind => Mind != null;
/// <summary>
/// Whether examining should show information about the mind or not.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("showExamineInfo")]
public bool ShowExamineInfo { get; set; }
/// <summary>
/// Whether the mind will be put on a ghost after this component is shutdown.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("ghostOnShutdown")]
[Access(typeof(MindSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
public bool GhostOnShutdown { get; set; } = true;
}
public sealed class MindRemovedMessage : EntityEventArgs
{
public EntityUid OldMindId;
public MindComponent OldMind;
public MindRemovedMessage(EntityUid oldMindId, MindComponent oldMind)
{
OldMindId = oldMindId;
OldMind = oldMind;
}
}
public sealed class MindAddedMessage : EntityEventArgs
{
}
}