Namespace cleanup around Mind Roles (#30965)

* namespaces

* Comment does not need a semicolon

---------

Co-authored-by: Vasilis <vascreeper@yahoo.com>
This commit is contained in:
Errant
2024-08-15 20:26:57 +02:00
committed by GitHub
parent f523df821a
commit 40b9fd4ea3
14 changed files with 2356 additions and 2370 deletions

View File

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