Mind ecs (#14412)
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
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 MindComponent : Component
|
||||
public sealed class MindContainerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The mind controlling this mob. Can be null.
|
||||
@@ -17,6 +20,7 @@ namespace Content.Server.Mind.Components
|
||||
/// True if we have a mind, false otherwise.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[MemberNotNullWhen(true, nameof(Mind))]
|
||||
public bool HasMind => Mind != null;
|
||||
|
||||
/// <summary>
|
||||
@@ -3,14 +3,8 @@ namespace Content.Server.Mind.Components
|
||||
[RegisterComponent]
|
||||
public sealed class VisitingMindComponent : Component
|
||||
{
|
||||
[ViewVariables] public Mind Mind { get; set; } = default!;
|
||||
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
Mind?.UnVisit();
|
||||
}
|
||||
[ViewVariables]
|
||||
public Mind Mind { get; set; } = default!;
|
||||
}
|
||||
|
||||
public sealed class MindUnvisitedMessage : EntityEventArgs
|
||||
|
||||
Reference in New Issue
Block a user