Show / Hide Table of Contents

Class SharedMindSystem

Inheritance
System.Object
SharedMindSystem
MindSystem
MindSystem
Namespace: Content.Shared.Mind
Assembly: Content.Shared.dll
Syntax
public abstract class SharedMindSystem : EntitySystem

Fields

| Improve this Doc View Source

UserMinds

Declaration
protected readonly Dictionary<NetUserId, EntityUid> UserMinds
Field Value
Type Description
Dictionary<Robust.Shared.Network.NetUserId, EntityUid>

Methods

| Improve this Doc View Source

AddObjective(EntityUid, MindComponent, EntityUid)

Adds an objective that already exists, and is assumed to have had its requirements checked.

Declaration
public void AddObjective(EntityUid mindId, MindComponent mind, EntityUid objective)
Parameters
Type Name Description
EntityUid mindId
MindComponent mind
EntityUid objective
| Improve this Doc View Source

CreateMind(Nullable<NetUserId>, Nullable<String>)

Declaration
public EntityUid CreateMind(NetUserId? userId, string? name = null)
Parameters
Type Name Description
System.Nullable<Robust.Shared.Network.NetUserId> userId
System.Nullable<System.String> name
Returns
Type Description
EntityUid
| Improve this Doc View Source

GetAliveHumansExcept(EntityUid)

Returns a list of every living humanoid player's minds, except for a single one which is exluded.

Declaration
public List<EntityUid> GetAliveHumansExcept(EntityUid exclude)
Parameters
Type Name Description
EntityUid exclude
Returns
Type Description
List<EntityUid>
| Improve this Doc View Source

GetCharacterName(NetUserId)

Declaration
public string? GetCharacterName(NetUserId userId)
Parameters
Type Name Description
Robust.Shared.Network.NetUserId userId
Returns
Type Description
System.Nullable<System.String>
| Improve this Doc View Source

GetMind(EntityUid, MindContainerComponent)

Declaration
public EntityUid? GetMind(EntityUid uid, MindContainerComponent mind = null)
Parameters
Type Name Description
EntityUid uid
MindContainerComponent mind
Returns
Type Description
System.Nullable<EntityUid>
| Improve this Doc View Source

GetMind(NetUserId)

Declaration
public EntityUid? GetMind(NetUserId user)
Parameters
Type Name Description
Robust.Shared.Network.NetUserId user
Returns
Type Description
System.Nullable<EntityUid>
| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

IsCharacterDeadIc(MindComponent)

True if this Mind is 'sufficiently dead' IC (Objectives, EndText). Note that this is IC logic, it's not necessarily tied to any specific truth. "If administrators decide that zombies are dead, this returns true for zombies." (Maybe you were looking for the action blocker system?)

Declaration
public bool IsCharacterDeadIc(MindComponent mind)
Parameters
Type Name Description
MindComponent mind
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsCharacterDeadPhysically(MindComponent)

True if the OwnedEntity of this mind is physically dead. This specific definition, as opposed to CharacterDeadIC, is used to determine if ghosting should allow return.

Declaration
public bool IsCharacterDeadPhysically(MindComponent mind)
Parameters
Type Name Description
MindComponent mind
Returns
Type Description
System.Boolean
| Improve this Doc View Source

MindOwnerLoggingString(MindComponent)

A string to represent the mind for logging

Declaration
public string MindOwnerLoggingString(MindComponent mind)
Parameters
Type Name Description
MindComponent mind
Returns
Type Description
System.String
| Improve this Doc View Source

RemoveVisitingEntity(MindComponent)

Cleans up the VisitingEntity.

Declaration
protected void RemoveVisitingEntity(MindComponent mind)
Parameters
Type Name Description
MindComponent mind
| Improve this Doc View Source

SetOwnedEntity(MindComponent, Nullable<EntityUid>, MindContainerComponent)

Sets the Mind's OwnedComponent and OwnedEntity

Declaration
protected void SetOwnedEntity(MindComponent mind, EntityUid? uid, MindContainerComponent mindContainerComponent)
Parameters
Type Name Description
MindComponent mind

Mind to set OwnedComponent and OwnedEntity on

System.Nullable<EntityUid> uid

Entity owned by mind

MindContainerComponent mindContainerComponent

MindContainerComponent owned by mind

| Improve this Doc View Source

SetUserId(EntityUid, Nullable<NetUserId>, MindComponent)

Sets the Mind's UserId, Session, and updates the player's PlayerData. This should have no direct effect on the entity that any mind is connected to, except as a side effect of the fact that it may change a player's attached entity. E.g., ghosts get deleted.

Declaration
public virtual void SetUserId(EntityUid mindId, NetUserId? userId, MindComponent mind = null)
Parameters
Type Name Description
EntityUid mindId
System.Nullable<Robust.Shared.Network.NetUserId> userId
MindComponent mind
| Improve this Doc View Source

Shutdown()

Declaration
public override void Shutdown()
| Improve this Doc View Source

TransferTo(EntityUid, Nullable<EntityUid>, Boolean, Boolean, MindComponent)

Transfer this mind's control over to a new entity.

Declaration
public virtual void TransferTo(EntityUid mindId, EntityUid? entity, bool ghostCheckOverride = false, bool createGhost = true, MindComponent mind = null)
Parameters
Type Name Description
EntityUid mindId

The mind to transfer

System.Nullable<EntityUid> entity

The entity to control. Can be null, in which case it will simply detach the mind from any entity.

System.Boolean ghostCheckOverride

If true, skips ghost check for Visiting Entity

System.Boolean createGhost
MindComponent mind
| Improve this Doc View Source

TryAddObjective(EntityUid, MindComponent, String)

Tries to create and add an objective from its prototype id.

Declaration
public bool TryAddObjective(EntityUid mindId, MindComponent mind, string proto)
Parameters
Type Name Description
EntityUid mindId
MindComponent mind
System.String proto
Returns
Type Description
System.Boolean

Returns true if adding the objective succeeded.

| Improve this Doc View Source

TryGetMind(PlayerData, out EntityUid, out MindComponent)

Declaration
public bool TryGetMind(PlayerData player, out EntityUid mindId, out MindComponent mind)
Parameters
Type Name Description
PlayerData player
EntityUid mindId
MindComponent mind
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetMind(EntityUid, out EntityUid, out MindComponent, MindContainerComponent)

Gets a mind from uid and/or MindContainerComponent. Used for null checks.

Declaration
public bool TryGetMind(EntityUid uid, out EntityUid mindId, out MindComponent mind, MindContainerComponent container = null)
Parameters
Type Name Description
EntityUid uid

Entity UID that owns the mind.

EntityUid mindId

The mind id.

MindComponent mind

The returned mind.

MindContainerComponent container

Mind component on uid to get the mind from.

Returns
Type Description
System.Boolean

True if mind found. False if not.

| Improve this Doc View Source

TryGetMind(NetUserId, out Nullable<EntityUid>, out MindComponent)

Declaration
public virtual bool TryGetMind(NetUserId user, out EntityUid? mindId, out MindComponent mind)
Parameters
Type Name Description
Robust.Shared.Network.NetUserId user
System.Nullable<EntityUid> mindId
MindComponent mind
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetMind(ICommonSession, out EntityUid, out MindComponent)

Declaration
public bool TryGetMind(ICommonSession player, out EntityUid mindId, out MindComponent mind)
Parameters
Type Name Description
Robust.Shared.Players.ICommonSession player
EntityUid mindId
MindComponent mind
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetRole<T>(EntityUid, out T)

Gets a role component from a player's mind.

Declaration
public bool TryGetRole<T>(EntityUid user, out T role)
    where T : Component
Parameters
Type Name Description
EntityUid user
T role
Returns
Type Description
System.Boolean

Whether a role was found

Type Parameters
Name Description
T
| Improve this Doc View Source

TryGetSession(Nullable<EntityUid>, out ICommonSession)

Declaration
public bool TryGetSession(EntityUid? mindId, out ICommonSession session)
Parameters
Type Name Description
System.Nullable<EntityUid> mindId
Robust.Shared.Players.ICommonSession session
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryRemoveObjective(EntityUid, MindComponent, Int32)

Removes an objective from this mind.

Declaration
public bool TryRemoveObjective(EntityUid mindId, MindComponent mind, int index)
Parameters
Type Name Description
EntityUid mindId
MindComponent mind
System.Int32 index
Returns
Type Description
System.Boolean

Returns true if the removal succeeded.

| Improve this Doc View Source

UnVisit(EntityUid, MindComponent)

Returns the mind to its original entity.

Declaration
public virtual void UnVisit(EntityUid mindId, MindComponent mind = null)
Parameters
Type Name Description
EntityUid mindId
MindComponent mind
| Improve this Doc View Source

UnVisit(ICommonSession)

Returns the mind to its original entity.

Declaration
public void UnVisit(ICommonSession player)
Parameters
Type Name Description
Robust.Shared.Players.ICommonSession player
| Improve this Doc View Source

Visit(EntityUid, EntityUid, MindComponent)

Declaration
public virtual void Visit(EntityUid mindId, EntityUid entity, MindComponent mind = null)
Parameters
Type Name Description
EntityUid mindId
EntityUid entity
MindComponent mind
| Improve this Doc View Source

WipeAllMinds()

Declaration
public virtual void WipeAllMinds()
| Improve this Doc View Source

WipeMind(ICommonSession)

Declaration
public void WipeMind(ICommonSession player)
Parameters
Type Name Description
Robust.Shared.Players.ICommonSession player
| Improve this Doc View Source

WipeMind(Nullable<EntityUid>, MindComponent)

Detaches a mind from all entities and clears the user ID.

Declaration
public void WipeMind(EntityUid? mindId, MindComponent mind = null)
Parameters
Type Name Description
System.Nullable<EntityUid> mindId
MindComponent mind
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾