using System.Diagnostics.CodeAnalysis;
using Robust.Shared.GameStates;
namespace Content.Shared.Mind.Components;
///
/// This component indicates that this entity may have mind, which is simply an entity with a .
/// The mind entity is not actually stored in a "container", but is simply stored in nullspace.
///
[RegisterComponent, Access(typeof(SharedMindSystem)), NetworkedComponent, AutoGenerateComponentState]
public sealed partial class MindContainerComponent : Component
{
///
/// The mind controlling this mob. Can be null.
///
[DataField, AutoNetworkedField]
public EntityUid? Mind { get; set; }
///
/// True if we have a mind, false otherwise.
///
[MemberNotNullWhen(true, nameof(Mind))]
public bool HasMind => Mind != null;
///
/// Whether examining should show information about the mind or not.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("showExamineInfo"), AutoNetworkedField]
public bool ShowExamineInfo { get; set; }
///
/// Whether the mind will be put on a ghost after this component is shutdown.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("ghostOnShutdown")]
public bool GhostOnShutdown { get; set; } = true;
}
public abstract class MindEvent : EntityEventArgs
{
public readonly Entity Mind;
public readonly Entity Container;
public MindEvent(Entity mind, Entity container)
{
Mind = mind;
Container = container;
}
}
///
/// Event raised directed at a mind-container when a mind gets removed.
///
public sealed class MindRemovedMessage : MindEvent
{
public MindRemovedMessage(Entity mind, Entity container)
: base(mind, container)
{
}
}
///
/// Event raised directed at a mind when it gets removed from a mind-container.
///
public sealed class MindGotRemovedEvent : MindEvent
{
public MindGotRemovedEvent(Entity mind, Entity container)
: base(mind, container)
{
}
}
///
/// Event raised directed at a mind-container when a mind gets added.
///
public sealed class MindAddedMessage : MindEvent
{
public MindAddedMessage(Entity mind, Entity container)
: base(mind, container)
{
}
}
///
/// Event raised directed at a mind when it gets added to a mind-container.
///
public sealed class MindGotAddedEvent : MindEvent
{
public MindGotAddedEvent(Entity mind, Entity container)
: base(mind, container)
{
}
}