Files
tbd-station-14/Content.Server/Mind/Components/MindContainerComponent.cs
ShadowCommander bfc4da9377 Mind ecs (#14412)
2023-03-26 14:31:13 -04:00

49 lines
1.5 KiB
C#

using System.Diagnostics.CodeAnalysis;
using YamlDotNet.Core.Tokens;
namespace Content.Server.Mind.Components
{
/// <summary>
/// Stores a <see cref="Server.Mind.Mind"/> on a mob.
/// </summary>
[RegisterComponent, Access(typeof(MindSystem))]
public sealed class MindContainerComponent : Component
{
/// <summary>
/// The mind controlling this mob. Can be null.
/// </summary>
[ViewVariables]
[Access(typeof(MindSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
public Mind? 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")]
public bool GhostOnShutdown { get; set; } = true;
}
public sealed class MindRemovedMessage : EntityEventArgs
{
}
public sealed class MindAddedMessage : EntityEventArgs
{
}
}