Revert "Mind ecs" (#14881)

This commit is contained in:
Leon Friedrich
2023-03-27 10:24:00 +13:00
committed by GitHub
parent c6c8fa2075
commit 4d71b1b81e
85 changed files with 684 additions and 1150 deletions

View File

@@ -6,15 +6,12 @@ using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
using System.Linq;
using Content.Server.Mind;
namespace Content.Server.Roles
{
[AdminCommand(AdminFlags.Admin)]
public sealed class AddRoleCommand : IConsoleCommand
{
[Dependency] private readonly EntityManager _entityManager = default!;
public string Command => "addrole";
public string Description => "Adds a role to a player's mind.";
@@ -57,8 +54,7 @@ namespace Content.Server.Roles
}
var role = new Job(mind, jobPrototype);
var mindSystem = _entityManager.System<MindSystem>();
mindSystem.AddRole(mind, role);
mind.AddRole(role);
}
}
}

View File

@@ -2,7 +2,6 @@ using Content.Server.Chat.Managers;
using Content.Server.Chat.Systems;
using Content.Shared.Roles;
using System.Globalization;
using Content.Server.Mind;
namespace Content.Server.Roles
{
@@ -36,11 +35,8 @@ namespace Content.Server.Roles
public override void Greet()
{
base.Greet();
var entityManager = IoCManager.Resolve<EntityManager>();
var mindSystem = entityManager.System<MindSystem>();
if (mindSystem.TryGetSession(Mind, out var session))
if (Mind.TryGetSession(out var session))
{
var chatMgr = IoCManager.Resolve<IChatManager>();
chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-introduce-job-name",

View File

@@ -1,5 +1,4 @@
using Content.Server.Administration;
using Content.Server.Mind;
using Content.Server.Players;
using Content.Shared.Administration;
using Content.Shared.Roles;
@@ -13,7 +12,6 @@ namespace Content.Server.Roles
public sealed class RemoveRoleCommand : IConsoleCommand
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
public string Command => "rmrole";
@@ -45,8 +43,7 @@ namespace Content.Server.Roles
}
var role = new Job(mind, _prototypeManager.Index<JobPrototype>(args[1]));
var mindSystem = _entityManager.System<MindSystem>();
mindSystem.RemoveRole(mind, role);
mind.RemoveRole(role);
}
}
}