Move minds, roles, jobs and objectives to shared (#19679)
This commit is contained in:
56
Content.Shared/Mind/Components/MindContainerComponent.cs
Normal file
56
Content.Shared/Mind/Components/MindContainerComponent.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Content.Shared.Mind.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Stores a <see cref="MindComponent"/> on a mob.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(SharedMindSystem))]
|
||||
public sealed partial class MindContainerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The mind controlling this mob. Can be null.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[Access(typeof(SharedMindSystem), 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(SharedMindSystem), 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
|
||||
{
|
||||
}
|
||||
}
|
||||
11
Content.Shared/Mind/Components/TransferMindOnGibComponent.cs
Normal file
11
Content.Shared/Mind/Components/TransferMindOnGibComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Mind.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class TransferMindOnGibComponent : Component
|
||||
{
|
||||
[DataField("targetTag", customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>))]
|
||||
public string TargetTag = "MindTransferTarget";
|
||||
}
|
||||
13
Content.Shared/Mind/Components/VisitingMindComponent.cs
Normal file
13
Content.Shared/Mind/Components/VisitingMindComponent.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Content.Shared.Mind.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed partial class VisitingMindComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public EntityUid? MindId;
|
||||
}
|
||||
|
||||
public sealed class MindUnvisitedMessage : EntityEventArgs
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user